what is a static property and a cursor question

  • Thread starter Thread starter Franky
  • Start date Start date
F

Franky

I think I misread a post and understood that if I do:

System.Windows.Forms.Cursor.Current = Cursors.WaitCursor

there is no need to reset the cursor to Default.



So I made all the reset statements into comments (placed an ' in front)

And everything works OK.



Now I'm wondering why.

Is it true that I do not need to reset the cursor or does leaving the sub do
that - or why is mine working?



Also, what is a static property. Is there only one value saved for the
entire application, for all Cursors, or what?



thanks for any clarifications
 
to awnser the static property question. You might actually mean a staic
variable.

The static keyword meand that the variable will keep it's value when the sub
or function exits. This is used to declare at the sub level, and not at the
class level.

And yes for the cursor question. You have to set the cursor back to default
:).

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
I think I misread a post and understood that if I do:

System.Windows.Forms.Cursor.Current = Cursors.WaitCursor

there is no need to reset the cursor to Default.



So I made all the reset statements into comments (placed an ' in front)

And everything works OK.



Now I'm wondering why.

Is it true that I do not need to reset the cursor or does leaving the sub do
that - or why is mine working?



Also, what is a static property. Is there only one value saved for the
entire application, for all Cursors, or what?



thanks for any clarifications
 
Ryan S. Thiele said:
to awnser the static property question. You might actually mean a staic
variable.

The static keyword meand that the variable will keep it's value when the
sub
or function exits. This is used to declare at the sub level, and not at
the
class level.

System.Windows.Forms.Cursor.Current is a Static property - whatever that
means!
And yes for the cursor question. You have to set the cursor back to
default
:).

But I don't - in many places - and it works OK - I wonder why


Thanks for the reply
 
Static means just that. For example

Public Sub DoWork()
Static i as integer = 0
i += 1 'You can also use i = i + 1
End Sub

Now, when oyu run the method. It will add one to i, making it 1. When you
run the method again, it will again add 1 to i, making it 2.

See how it keeps the value after the method has executed. The static
variable stays in the memory.

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
ews:[email protected]...


Ryan S. Thiele said:
to awnser the static property question. You might actually mean a staic
variable.

The static keyword meand that the variable will keep it's value when the
sub
or function exits. This is used to declare at the sub level, and not at
the
class level.

System.Windows.Forms.Cursor.Current is a Static property - whatever that
means!
And yes for the cursor question. You have to set the cursor back to
default
:).

But I don't - in many places - and it works OK - I wonder why


Thanks for the reply
 
I see what the problem is. I'm asking what the static property means and
that can be taken two ways.
I understand the static property of a variable.

What I wanted to ask is what does

Static Property zzz....

mean


System.Windows.Forms.Cursor.Current

the property Current is Static

what does that mean?



Thanks
 
It means you can change or access it anywhere in the program. It is help in
the memory at a global level.

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
I see what the problem is. I'm asking what the static property means and
that can be taken two ways.
I understand the static property of a variable.

What I wanted to ask is what does

Static Property zzz....

mean


System.Windows.Forms.Cursor.Current

the property Current is Static

what does that mean?



Thanks
 
Ryan S. Thiele said:
It means you can change or access it anywhere in the program. It is help
in
the memory at a global level.

In contrast to having to create an instance of the class first. It must
apply to all instances (I guess).

thanks
 
Franky,

Don't mix up the use of the old C++ keyword static what is used in C# as
well.

In VB.Net this is "Shared" the declared word can be used shared and exactly
as that means by all classes in your program. The static keyword is as
declared above it is static inside a method.

Cor
 
Exactly I took the popular tongue.

Although it is as well for all "shared classes" and modules (which are in
fact the same).

:-)

Cor
 
I think we took care of that.

Now if I can find some doc on MSScriptControl.ScriptControlClass I'd feel
like I'm moving on.

THANKS
 
Back
Top