Property or method or something?

E

el zorro

I'm just looking for a discussion of the difference
between the following two lines of code:
[FormTab].Visible = True
[FormTab].SetFocus

THey do what I want them to do when triggered by a
control event: they make FormTab visible and set the
focus on that tab (from among several tabs).

But the two lines are curious to me in a nerdly sort of
way. For example "[FormTab].Visible" does not work for
the first, and if I set the secont line to "True", that
doesn't work either. So there appears to be some basic,
structural difference between "Visible" and "SetFocus,"
but I don't quite get what it is. IS it the difference
between a property and a method or something like that?
 
B

Brian

el zorro said:
I'm just looking for a discussion of the difference
between the following two lines of code:
[FormTab].Visible = True
[FormTab].SetFocus

THey do what I want them to do when triggered by a
control event: they make FormTab visible and set the
focus on that tab (from among several tabs).

But the two lines are curious to me in a nerdly sort of
way. For example "[FormTab].Visible" does not work for
the first, and if I set the secont line to "True", that
doesn't work either. So there appears to be some basic,
structural difference between "Visible" and "SetFocus,"
but I don't quite get what it is. IS it the difference
between a property and a method or something like that?

That's exactly it: Visible is a property (i.e. something that an object HAS
or IS), SetFocus is a method (i.e. something that an object DOES).
 

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

Top