|
I think is should read
Module Program
anmd not
Class PRogram
|
|
|
|
|
If you open the projects' properties, you'll find that they entry-point is "Module1". Change that, or change the code to using a module;
Namespace testStopWatch
Public Module1
Shared Sub Main(ByVal args() As String)
End Sub
End Module
End Namesapce
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I dont get that when I open a new project in VB console:
Module Module1
Sub Main()
End Sub
End Module
Why the sheard sub main?
|
|
|
|
|
You're absolutely right, it shouldn't be "shared" when in a module, only when in a class. My bad
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Ah, I though I had missed a lesson there
|
|
|
|
|
Kenneth Haugland wrote: Ah, I though I had missed a lesson there Noes, I'm just bad at remembering those lessons. And, there's no compiler-warnings when editing code in a post
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Just figured out, from my previous posts, that it dosnt spell check either.
|
|
|
|
|
..hehe, I used Google Translate on "sheard" and realized it had to be "shared" when typing
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Does VB.Net has a timer function, I want to use a timer like:
timer.start();
do sth1
timer.now() in milliseonds
do sth2
timer.now() in milliseconds
d0 sth3
timer.now() in milliseconds.
Now I use Now() function, but I felt this function can't produce precise result.
And I googled stopwatch class, but it needs start(), stop() repeatedly.
modified 11-Apr-13 14:27pm.
|
|
|
|
|
econy wrote: And I googled stopwatch class, but it needs start(), stop() repeatedly. Not according to the manual;
You can query the properties Elapsed, ElapsedMilliseconds, and ElapsedTicks while the Stopwatch instance is running or stopped.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
The Stopwatch[^] doesn't need repeated calls to Start[^] and Stop[^]. At most, if you want to reset the elapsed time between readings, you would call the Restart[^] method.
Dim timer As Stopwatch = Stopwatch.StartNew()
do sth1
timer.ElapsedMilliseconds
timer.Restart()
do sth2
timer.ElapsedMilliseconds
timer.Restart()
do sth3
timer.ElapsedMilliseconds
timer.Stop()
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
What are you looking to do with this timer? Your post doesn't make any sense as "timer.now()" is meaningless. There is no "Now()" property or method on any of the Timer classes.
There are various types of timers in the .NET Framework, each is designed to handle different situations, but I don't think that's what you're trying to do.
If you're talking about starting a stopwatch and getting an elapsed time at various points in a process, then you use the Stopwatch class. To get your interval times, you just get the value in the Stopwatch.Elapsed, Stopwatch.EllapsedMilliseconds, or EllapsedTicks properties. You don't have to stop the stopwatch to do that.
|
|
|
|
|
Thanks, Now I understand the stopwatch class
|
|
|
|
|
I using ; 1 Textbox (for keyword), 1 Button (for Search Button), 1 ListView (Data List) and 1 label (for Result/Search information).
Thanks for help before
Best Regards
VB2010 Newbie
|
|
|
|
|
..and what have you tried upto now? Have you worked with a ListView before?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello,
I created an application for Windows CE 5.0 in VB. The class application AppCEClass is inherited from Microsoft.WindowsCE.Forms.MessageWindow. I have a problem to launch an application, because something like this does not work:
Public Shared Sub Main()
Application.Run(New AppCEClass())
End Sub
Windows does not recognize the class name and throw error AppCEClass() cannot be converted on System.Windows.Forms.Form.
What to do?
modified 11-Apr-13 9:22am.
|
|
|
|
|
I think your application should inherit from System.Windows.Forms.Form .
Use the best guess
|
|
|
|
|
yes, that's what I was trying to get across in the other thread by providing an example.
Re-WndProc-does-not-work-in-Windows-CE-5-0.aspx
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
I often wonder why some questioners make life so difficult for themselves, and go round and round in circle rather than accepting advice or guidance.
Use the best guess
|
|
|
|
|
> "I often wonder why some questioners make life so difficult for themselves, and go round and round in circle rather than accepting advice or guidance." <
Yes, it's like they're blinded by their own self belief that they are right, can't see at all. Even when they patently don't have a deep understanding of coding and won't admit it.
There's not much point continuing to help them, so I send them elsewhere.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
I looked the following code in MSDN, but don't know how to test it. is onMouseDownClickcount() an event handler? then how can I link it to a control, ex: button?
The following example creates a MouseButtonEventHandler which determines if a single, double, or triple click occurred. ClickCount property is used to determine the number clicks.
private void OnMouseDownClickCount(object sender,
MouseButtonEventArgs e)
{
if (e.ClickCount == 1)
{
lblClickCount.Content = "Single Click";
}
if (e.ClickCount == 2)
{
lblClickCount.Content = "Double Click";
}
if (e.ClickCount > 3)
{
lblClickCount.Content = "Triple Click";
}
}
|
|
|
|
|
You found that here[^], didn't you? You ought to tell us the source.
It looks like an event handler for mouse events in a WPF application. Hence you cannot use it in a Windows Forms application.
|
|
|
|
|
yes, I found the code in MSDN website.
|
|
|
|
|
Hello,
I am doing program in VB for Windows CE 5.0. I need to catch messages from other programs in VB window. In VB is defined a function WndProc. But, this function does not work (or exist) on CE. Compiler cannot recognize it.
Protected Overrides Sub WndProc(ByRef recWinMessage As Microsoft.WindowsCE.Forms.Message)
MyBase.WndProc(recWinMessage)
End Sub
Can anyone help me?
|
|
|
|