|
Thank you Pete, i see now what you mean. So easy when you have the expertise. 
|
|
|
|
|
this could also be your Solution - integrate the functionality into your own customized Textbox :
Public Class NumericTextbox
Inherits TextBox
Private Sub NumericTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles Me.KeyPress
Dim keyChar = e.KeyChar
If Char.IsControl(keyChar) Then
ElseIf Char.IsDigit(keyChar) OrElse keyChar = "."c Then
Dim box As TextBox = DirectCast(sender, TextBox)
Dim text As String = box.Text
Dim selectionStart As Integer = box.SelectionStart
Dim selectionLength As Integer = box.SelectionLength
text = text.Substring(0, selectionStart) & keyChar & text.Substring(selectionStart + selectionLength)
Dim valueInt32 As Integer
Dim valueDouble As Double
If Integer.TryParse(text, valueInt32) AndAlso valueInt32 > 999 Then
e.Handled = True
ElseIf Double.TryParse(text, valueDouble) AndAlso text.IndexOf("."c) < text.Length - 4 Then
e.Handled = True
End If
Else
e.Handled = True
End If
End Sub
End Class
|
|
|
|
|
Hey @all
I wish a very good new year 2021 to you
I am from Germany and new in here and I have already read many interesting articles.
I have a problem and whether google knows sth about that than me. I try to explain it to you now.
I am designing a testing environment which i am appealing to via CAN-Bus and a 2 Channel CAN Interface.
It all runs on C# with VS2019.
I use one form to communicate to my test environment CAN Channel.
Another form is used for CAN on my tested device.
in the third form I designed my GUI. So far it is working very well.
I builded the .exe and copied it to another directory.
Now I try to start this exe with another form, called launcher, because i design many GUIs which are built to .exe files.
Some of my GUIs start from the launcher, but some do not. One form of the CAN Interface is showing up, but is then closing.
When I click on the exe in this directory directly, everything is working fine!
But I only got it with 2 GUIs. The other 10 GUIs are working well in this.
The Launcher is written on .netcore3.1.
Also the GUIs are.
I tried also with .net4.7.2, cause I am also using Measurement Studio of NI.
I do not know any reason for that issue. I can not explain that to me :/
Does anybody have had an issue like that?
If you need further Informations, please ask me for that.
I am very desperasted on that.
Thank you in advance.
With best regards,
Daniel
|
|
|
|
|
Member 14955332 wrote: Some of my GUIs start from the launcher, but some do not. One form of the CAN Interface is showing up, but is then closing.
When I click on the exe in this directory directly, everything is working fine!
How do you launch your exes? Are you using the exe's full pathname?
|
|
|
|
|
Hi, sorry for my late reply.
i wanted to use relative paths. Now I tried with absolute patz directly on C://
it is the same problem.
The exe is started but then the problem appeared. So Pathname is OK
How I call the exe:
private void btStart_Click(object sender, EventArgs e)
{
string opentest = "C:\\TesterV4\\Data\\Tests\\" + lbHersteller.SelectedItem.ToString() + "\\" + lbTests.SelectedItem.ToString() + "\\netcoreapp3.1\\Basis.exe";
try
{
Process p = new Process();
p.StartInfo.FileName = opentest;
p.Start();
p.WaitForExit();
}
catch
{
MessageBox.Show("Datei konnte nicht gefunden werden", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
|
|
|
|
|
Maybe there is a similar problem (pathname) in the exe you are starting?
|
|
|
|
|
The only way you are going to resolve this is to add some logging/debugging code to the started program. It is impossible for anyone here to guess what it is doing.
|
|
|
|
|
Hello all
I'm new here and wanted to ask about .Net and Vue.js.
I have to do a project at school that is not so simple in my opinion.
I should develop a web application that should work with .NET and Vue.js.
I have to generate a PDF document with the user's input and send it to a mail. I also have to identify the mail address from the user's input and send it to him.
Can you help me how I can approach the whole thing. I am grateful for any help.
Thanks a lot
|
|
|
|
|
Of course you can get help - you only need to ask a specific question ...
So ... where do you stuck ?
But one thing you should realize first : this is not a "do the whole work for me"-Forum ...
|
|
|
|
|
Dir all. I am a new here. I just start a Web NETcore 5.0 MVC and the connectionstring has been set in the
appsettings.json like this:
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=ManagementSystem;Trusted_Connection=True;MultipleActiveResultSets=true"
}
I know that the database will be create in the "
C:\Users\Nguyen Tuan Anh "
You can see the projet is here: GitHub - nguyentuananh921/HomeJob[^]
I want to setup the database so it is created in Project Folder as a relative not fix so that when I upload to github and then I can come to other pc and clone it without losing data.
Thanks.
|
|
|
|
|
What are your thoughts on an approach that uses Specifications for business logic validation? I know Fluent Validation is probably the most popular tool for doing validation these days, but is it inherently superior to a Specification-based approach?
|
|
|
|
|
More straight-jackets from pet projects of third parties.
The antithesis of "fluent".
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Can you expand on your "antithesis of 'fluent'" comment, please?
|
|
|
|
|
Hey,
A bit backstory: I am working for some time on my Text-Templating engine project Morestachio and all the time i compare the performance of Morestachio against other engines like cottle, handlebars.net, scribain etc and with the latest release of .Net5 i was thrilled as microsoft promised another out-of-the-box performance improvement like the one we saw when net.core came out where each version was measurably faster then the previous one. I read some block posts like this one: Performance Improvements in .NET 5 | .NET Blog but when i did my usual performance comparisons I discovered more or less the opposite.
I have two performance metrics: Historical performance tests including only Morestachio using Nunit and a project using the BenchmarkDotNet lib.
BenchmarkDotNet:
.net472:
| Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|------- |---------:|----------:|----------:|---------:|--------:|------:|----------:|
| Bench | 2.019 ms | 0.0041 ms | 0.0036 ms | 257.8125 | 15.6250 | - | 1.57 MB |
.NET5:
| Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|------- |---------:|----------:|----------:|--------:|-------:|------:|----------:|
| Bench | 2.219 ms | 0.0044 ms | 0.0039 ms | 85.9375 | 3.9063 | - | 705.5 KB |
.NetCore 3.1:
| Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|------- |---------:|----------:|----------:|--------:|-------:|------:|----------:|
| Bench | 1.427 ms | 0.0035 ms | 0.0033 ms | 95.7031 | 5.8594 | - | 783.67 KB |
this also performance difference is also present in the other test (i will not bother to post here).
Yes Net5 is way more efficient in memory consumption but in comparison slower then even pre NetCore.
|
|
|
|
|
If I put bigger or smaller wheels on a car, it will affect it's speed; all other things being equal.
Memory and response time is like that. And we have different cars.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
|
For an article I wanted to create a VB.Net demo project with Master/Detail GridView and RichTextColumn.
Parts of my demo project are taken from CP articles about Master/Detail GridViews.
But most of them have the issue with the keys not working on the childView - that prevents moving through the child grid with arrow keys.
Same happens with keys page up/down and pos1/end.
Example: DataGridViewExtension[^]
Instead of navigating through the childView those keys let you navigate through the Main/Parent Form.
There is only one without that issue - but in C# and I do not understand how the issue is fixed there:
Master Detail Datagridview in C#[^]
That's why I tried to do the childView with my own subForm, but that was no good idea.
Today I could migrate that C# project (without the issue) to vb and got it working - without the keys issue.
But still cannot see the reason for the keys issue and why all works in the Master Detail Datagridview in C#.
Any ideas what causes the keys issue and how to fix it?
modified 11-Nov-20 13:53pm.
|
|
|
|
|
The "parent key" is used to filter children in the "child view"; that's it.
Every time the selected parent changes, a new set of children is retrieved or filtered using the parent key.
That's the pattern. How people choose to abuse it, is another matter.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I probably do not understand what mean - why should an 'Id'-Key which filters the datasource of the childView control have any effect on the function of the 'Keyboard'-Keys for the childView control?
modified 12-Nov-20 6:10am.
|
|
|
|
|
It doesn't. Where did I mention "key board"?
If your problem is that your "app" is not behaving as "expected", it's because you've either hooked up something wrong, or didn't when you should, or defeated it's default behavior.
I was telling you what "should" happen. You implement parent-child relations; they don't just "happen".
(And VB had "navigation controls" that c# never had).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
hey bro i want to add audit trail to my project ,bro i was seen your post about that but not working for me can u help me , i use asp.net core 3
|
|
|
|
|
|
it is not working for me i want audit log not logging logs !!
|
|
|
|
|
It is exactly the same concept. The important thing is what information you put in the log.
|
|
|
|
|
i'll try more different ways but not working for me , i want audit to record every things in my system where user performed !
|
|
|
|