frustrated

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hi,
I just spend 15 minutes looking for the correct use of dateandtime.timer.
That stupid 'help' from .NET2002 describes the timer function perfectly, but
when using it you get an error "is a type ....". So some prefix is
necessary, but thats not described in the help page. I miss that a lot in
the help pages.
Frank
 
Frank,

There are 4 timers in VBNet
the window.forms.timer
the system.timers.timer
the threading.thread.timer
and the one you took and most people even do not know that it exist.

I advise you to use the first one, for common forms application that one is
very good to use.

The most easy way to use it is to drag it from your form control toolbox
(not components that is the system) to your form. Than set in the properties
it to enabled, set the duration it has to go in milliseconds, Than in your
code you choose left in the combobox on top the timer1 and than in the right
combobox the click event. Than you are ready to type in the code that than
has to be done.

I hope this helps?

Cor
 
No Cor, that doesn't help. I was only frustrated that I had to search so
long for the prefix dateandtime. It should be on the helppage.

I needed the timer functionality just as dateandtime.timer provided, which
is time in seconds since midnight.

Regards
Frank
 
Thanks Cor, that will come in handy.
But I don't get it: I'm using the INT function without the prefix
'conversion' and now I want to use 'timer' I have to add 'dateandtime'. Do I
have to conclude that some VB functions are imported automatically and some
are not? Is that described somewhere?
Regards
Frank
 
Frank,

A part of this is easy to explain, however it are two questions in my
opinion.

Go to solution explorer go to the application (not the solution), rightclick
and open properties and in that the tab imports, there you see what is
imported without the import clause. You can add there as well of course.

Than the dateandtime is a part of the MVB namespace where from is written

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vamscdatetimemodule.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctInt.asp

Mostly it is important with this if a method is ambiguous (exist in more
namespaces)

I hope this helps?

Cor
 
Ok, thanks Cor

Cor Ligthert said:
Frank,

A part of this is easy to explain, however it are two questions in my
opinion.

Go to solution explorer go to the application (not the solution), rightclick
and open properties and in that the tab imports, there you see what is
imported without the import clause. You can add there as well of course.

Than the dateandtime is a part of the MVB namespace where from is written

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/
vamscdatetimemodule.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/
vafctInt.asp

Mostly it is important with this if a method is ambiguous (exist in more
namespaces)

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top