Why Does VS Remove My Parens, i.e. Timer() -> Timer

  • Thread starter Thread starter eBob.com
  • Start date Start date
E

eBob.com

My VB.Net app will require a timer of some sort. So I did some
research and decided to use System.Windows.Forms.Timer, I guess mainly
because while I have practically no experience with Events, I have
absolutely no experience will CallBacks.

The only example I've been able to find for this control is in the
Petzold book. It uses the following line of code to instantiate the
timer ...

Dim tmr As New Timer()

But when I enter that line of code, as soon as I move the cursor to
the next line the ()s disappear! I do have an Imports statement for
System.Windows.Forms.Timer.

I suppose I am doing something dumb (I am really new to this stuff)
but I can't imagine what.

I'll appreciate any help or pointers.

Bob
 
People were getting confused between that and array delcarations...

In 2002/1.0 you could do that..

2003/1.1 feature removed.
 
Ebob,

When you are busy with timers, watch that there are 4 timers,
windows.forms.form.timer
windows.system.timer
threading.thread.timer
and one in the Microsoft.visualbasic namespace.

This can confuse very much because in the documentation it is seldom told.
When you have simple single threading operations within one form I advice
you to take the first.

http://msdn.microsoft.com/library/d...ml/frlrfsystemwindowsformstimerclasstopic.asp

A sample is in this document.

I hope this helps?

Cor
 
CJ Taylor said:
People were getting confused between that and array delcarations...

In 2002/1.0 you could do that..

2003/1.1 feature removed.

In VB 2005's IDE support, AFAIR the '()' will be kept on ctor calls.
 
CJ Taylor said:
Does that mean in 2007 it will be removed again? =)

I would prefer a checkbox in the code formatting rules settings:

[_] Remove '()' on constructor calls
 
Back
Top