Property or method or something?

  • Thread starter Thread starter el zorro
  • Start date Start date
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?
 
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).
 
Back
Top