From: Leo on
I am in the process of building a VB6 class that represents the Windows
startbutton. Currently it has two properties, one to set the caption of the
button and one to enable or disable it. Currently setting either property
sets that property of the actual start button. Should I be setting these
properties via a method?
From: Larry Serflaten on

"Leo" <Leo(a)discussions.microsoft.com> wrote
> I am in the process of building a VB6 class that represents the Windows
> startbutton. Currently it has two properties, one to set the caption of the
> button and one to enable or disable it. Currently setting either property
> sets that property of the actual start button. Should I be setting these
> properties via a method?

A bit subjective, each may have their own perspective....

I'd say you've already got it right that the Caption and Enabled properties
should be exposed as properties. Something that might work well as a
method would be a SelectItem(MenuPath) where the MenuPath identifies
the desired item, nested however far down the menu structure:

SelectItem "Settings/Control Panel/Power Options"

Where the outcome of calling that method launches the Power Settings
dialog.

In short (IMHO) something that has a value, should be a property.
Whereas, something that has an action (launching a dialog) should
be a method.

That said, you should define your own rules for picking between
the two, and use those rules consistantly.

LFS


From: Cor Ligthert[MVP] on
Your height is a property from you.

There is no need to evaluate that in a method as you have it already written
on your chest with a label.

Measuring you can be a method which set that property but if you know it
already why would you measure it all the time, therefore it is a property.

"Leo" <Leo(a)discussions.microsoft.com> wrote in message
news:32F5EA4A-82C9-45DA-826D-15D47718B15F(a)microsoft.com...
> I am in the process of building a VB6 class that represents the Windows
> startbutton. Currently it has two properties, one to set the caption of
> the
> button and one to enable or disable it. Currently setting either property
> sets that property of the actual start button. Should I be setting these
> properties via a method?

From: Henning on
????

Has Cor got new sponsormoney to pay for the internet connection?

/Henning

"Cor Ligthert[MVP]" <Notmyfirstname(a)planet.nl> skrev i meddelandet
news:OjrreARyKHA.5132(a)TK2MSFTNGP05.phx.gbl...
> Your height is a property from you.
>
> There is no need to evaluate that in a method as you have it already
> written on your chest with a label.
>
> Measuring you can be a method which set that property but if you know it
> already why would you measure it all the time, therefore it is a property.
>
> "Leo" <Leo(a)discussions.microsoft.com> wrote in message
> news:32F5EA4A-82C9-45DA-826D-15D47718B15F(a)microsoft.com...
>> I am in the process of building a VB6 class that represents the Windows
>> startbutton. Currently it has two properties, one to set the caption of
>> the
>> button and one to enable or disable it. Currently setting either property
>> sets that property of the actual start button. Should I be setting these
>> properties via a method?
>