Should my properties be a method or set by a method

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?
0
Utf
3/21/2010 1:08:01 PM
vb.general.discussion 1016 articles. 0 followers. Follow

3 Replies
1156 Views

Similar Articles

[PageSpeed] 8

"Leo" <Leo@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


0
Larry
3/21/2010 2:03:22 PM
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@discussions.microsoft.com> wrote in message 
news:32F5EA4A-82C9-45DA-826D-15D47718B15F@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? 

0
Cor
3/21/2010 4:03:56 PM
????

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

/Henning

"Cor Ligthert[MVP]" <Notmyfirstname@planet.nl> skrev i meddelandet 
news:OjrreARyKHA.5132@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@discussions.microsoft.com> wrote in message 
> news:32F5EA4A-82C9-45DA-826D-15D47718B15F@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?
> 


0
Henning
3/21/2010 6:16:03 PM
Reply:

Similar Artilces:

HELP: Deleted Items Limit Set to 0 days does not work!
Hi Gurus, I've set the Deleted Items Limit to 0 days from the Deletion Setting at the Mail store level but when i delete an item from one of the mailbox it does not removed from the server immediately. Has anyone come accross this issue? Please advice. Thanks in advance On Wed, 2 Feb 2005 20:20:23 +0800, "hanafiah" <hanafiahh@hotmail.com> wrote: >Hi Gurus, > >I've set the Deleted Items Limit to 0 days from the Deletion Setting at the >Mail store level but when i delete an item from one of the mailbox it does >not removed from the server immediat...

Outlook Client makes Settings & Customization menus disappear
Hi all, I've noticed that now I've installed the Outlook Client for MS CRM 3.0, my Settings & Customization menus disappear in the web client. I realise that they shouldn' t be in the Outlook Client (no problem) and figure it's due to a conflict between the two... I've tried deleting my temporary Internet files which works, but was wondering if anyone had found a better (one off) solution that doesn't need this sort of repeated intervention. There are 3 of us who have admin access rights that disappear in this way, so while it's not a huge problem for us (...

Copy html table to word not keeping settings
I want to copy a html table to a word programatically. I have manage to get to a point where the table is pasted. But the paste is not the same as if i would use Ctrl+V or Edit/Paste. For merged cells the font settings are not kept. Is there a way to keep the settings for merged cells? Or a way to paste the html table in a word like the Ctrl+C/Ctrl+V does? ...

pop3 server and smtp what to write in set up to use outlook
I feel really dumb but I do not know what top type where it asks for POP3 server name and SMTP. Can anyone please help me? Thank you// "tomas08" <tomas08@discussions.microsoft.com> wrote in message news:C03476E1-D08C-493A-8ED0-A44D039D6B87@microsoft.com... >I feel really dumb but I do not know what top type where it asks for POP3 > server name and SMTP. Can anyone please help me? > > Thank you// You'll have to contact your ISP for that info or it may be posted on your ISP's website. On Sat, 1 Dec 2007 08:30:00 -0800, tomas08 <tomas08@discussion...

Use combo to print report between two sets of dates
I am trying to print a report that shows timesheet entries for two sets of dates. The report also prints out based on the data entry person selected. The user selects their name and then uses another combo box to select pre entered dates. My code is as follows: Private Sub cboDates_Click() Dim stDocName As String Dim FromDate As Date 'Name of criteria start timesheets date field. Dim ToDate As Date 'Name of criteria end timesheets date field. Dim FromOTDate As Date 'Name of criteria start OT date field. Dim ToOTDate As Date 'Name of criter...

IInternetProtocol Start Method not working correctly
Hello, I've been searching and searching and found nothing to help me out. Here's my situation: I need to capture URL Requests (clicks or address bar entries) and if it matches a specific URL like "http://somedomain.com/blorg.exe" I want to be able to intercept that and tell IE i'll take care of it myself, OR, if it does not pass my criteria, let IE handle the click. I DO NOT want to register my own protocol like mark://somedomain.com/.... I need to be able to look at the whole URL This is what I've done so far: I have created a namespacehandler in the HKCR are...

Method to group lines
Hi, I have this kind of sheet: 1?? AA1 2?? BB1 3?? CC1 3?? CC2 3?? CC3 3?? CC4 3?? CC5 2?? BB2 3?? CC6 3?? CC7 3?? CC8 1?? AA2 2?? BB3 3?? CC9 3?? CC10 3?? CC11 every rows it's a cell. The first number is the level of depth. How can I group group the rows by the level? I need to use the function "Group" of Excel, so I can hide/show rows. In this way I would see, before all the 1 then I expand them and I see only the 2 and so on... Thanks in advance for your help! -- Ciao BlackSun I usally add 3 auxilary column to the worksheet.. these could ...

Test environment set up
I want to set up a test environment for CRM. I understand how to import and export customizations. What I don't understand is how I will have another CRM instance under the same domain? Should I use the Adventure Works or just use my CRM license on a different server? Even with the Adventure Works, doesn't it have to connect to my domain and my AD and won't that mess things up? you can use virtualpc or even install a simple two server setup where one server functions as a domain controller in a new forest (is disconnected from your companies domain entirely) then add a ...

Problems Setting Delegate Permissions
I'm getting the following error message with Outlook 2003 and Exchange Server 2003. Does anyone know how to repair this? This occurs everytime I try to set Delegates for a user, or any user for that matter. I get to the point where I have assigned a user the permissions and when I click OK, I get the following: Microsoft Office Outlook The Delegates settings were not saved correctly. Unable to activate send-on-behalf-of list. You do not have sufficient permission to perform this operation on this object. Thanks for your help, Can you explain how your AD environment is setup. Singl...

any method for creating folders on the fly?
I own a domain, and I sign up at individual sites using that domain@mydomain.com- so I can see who sells me down the river. my host sends these all to me at a different address- they still come as though addressed to the address I put in. the regular ones, most of these I have setup to go into their own folders.-- but I make new ones EVERY day. I'd like to create a rule (and I realize stock outlook can't do this) that says "move all emails sent to anyaddress@mydomain.com to folder anyaddress" and "create that folder if it does not exist." anyone? am I i...

How to set resolution of brochure.
Can anyone tell me how to create a brochure with a resolution of 300 or 400. Also, how can I see the resolution? I created one using the defaults but when I converted to open it in PhotoShop, it had a dpi of 150. A small child turns to Ed, and exclaims: "Look! Look! A post from anonymous@discussions.microsoft.com <anonymous@discussions.microsoft.com>!"... > Can anyone tell me how to create a brochure with a > resolution of 300 or 400. Also, how can I see the > resolution? I created one using the defaults but when I > converted to open it in PhotoShop, it had...

Trying to do progress bar
I have a Form with a progress bar and a thread that should update the progress every quarter of a second. The operation being monitored for progress on is a file loading job. So I start off the monitor like this: long currprogress = 0; FileInfo info = new FileInfo(currFile); long maxprogress = info.Length / 100; bool IsMonitoring = true; Thread monitor = new Thread(new ThreadStart(RunMonitor)); monitor.Start(); (the scope of these variables is class level though, just made them local scope for easier reading) Then my RunMonitor method looks like: private void RunMonit...

How do I set up a template to save time typing names
I have to send a lot of e-mails to the same people, and always more than one person. How do I set up a template so that I don't have to keep typing who it is to and who I am 'Cc' to? traceyella <traceyella@discussions.microsoft.com> wrote: > I have to send a lot of e-mails to the same people, and always more > than one person. How do I set up a template so that I don't have to > keep typing who it is to and who I am 'Cc' to? Create your message, but instead of sending it, save it as an OFT. WHen you want to send it, forward it from your Drafts fold...

How do I set the size of a chart in excel (without using the mous.
How do I set the size of a chart in excel (without using the mouse)? You can set the size programmatically: With ActiveSheet.ChartObjects(1) .Width = 300 .Height = 200 End With katy wrote: > How do I set the size of a chart in excel (without using the mouse)? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html Hi, If you hold the shift key whilst selecting the chart you can move with the cursor keys. CTRL+1 will display the format dialog which will allow you to alter the height and width. Only thing is I don't know how to select t...

T/F Can't set Hyperlink base from within macro
Excel 2000. I wanted to set the Hyperlink base from within a macro. Then I read: "BuiltinDocumentProperties Property Returns a DocumentProperties collection that represents all the built-in document properties for the specified workbook. Read-only." Among the listed built-in properties is "Hyperlink Base". Putting that together with "read only", I deduce that although I can set the Hyperlink Base as a user, this cannot be done via a macro. Am I correct or is there a loophole somewhere that would allow me to do this? Chris Beall Hi Chris: Sub chris3() ...

How to save settings for my printer to print doublesided from exce
When I print doubled sided in word everything goes fine but whenever I try to print doublesided from excel and I go for advanced on my printer and check the boxes for it and then klick ok - after that I go in there to check that it's ok and then all my settings are gone.. Why and how can I change this so that I can print double sides in excel aswell? ...

Setting text color to black in inactive combo boxes
Hi, I have a dialog with several edits & combo boxes (and labels too). The data is shown for view only and i need it to be shown in black color (text). For the edits i use the read-only property and it's doing the job. With the combo's i have a problem, The text is displayed in gray no matter what... anyone? Thanks. yuval.gatenio@gmail.com wrote: > Hi, > > I have a dialog with several edits & combo boxes (and labels too). > > The data is shown for view only and i need it to be shown in black > color (text). > > For the edits i use the read-only...

Excel smart icon settings
Does anyone know in which file the "smart icons" settings are saved ? Tx Pegasus --------------------------------------------------------------------- "Eliminate annoying spam! My mailbox is protected by iHateSpam, the #1-rated spam buster." http://www.ihatespam.net ...

Outlook to Domino connector; setting default email account
Hi, I'm using the Outlook to Lotus Domino/Notes connector to access our calendar system and contacts. But I use an IMAP account for receiving and sending mail. The problem is that even though I have set the IMAP account to be the default account, all new mail, (when I choose " New Mail message") is sent via the domino server. If I click the "Accounts" drop down button the first name on the list is Outlook Connector for Domino, but the IMAP account is listed as account number 1, and the Outlook connector for Domino is listed as number 2. Any suggestion swould be...

Outgoing IMAP isn't working, can't change SMTP setting
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Email Client: imap Can't send from IMAP account. <li> It worked yesterday. No changes made on my end or host end (that they know of). <li> Error message: -3259, An operation on the server timed out. The server may be down, overloaded, or there may be too much net traffic. <li> I can send via web mail and my SugarCRM client. <li> My incoming works fine. <li> My outgoing set up is same as incoming, which is selected under the account and matches my hosting provider's instructions. <li> My ho...

Set the initial Frame size from the view size
Hello, I'm writing a Single Document Application and I want for the View client Rectangle a CRect: (0,0,400,300). How can I set the initial Frame size? ( the window rectangle of the frame is larger because of the window border, menu, toolbar and status bar) Thank you, E.A. ...

"Private" as Default Calendar Item Setting possible?
I want to force my Outlook2000 to mark every new calendar entry as "private". Until yet I did not find any solution - anybody who can help me? Thank you! You will need to do this manually - there is no option to mark everything private by default in Outlook 2000. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After furious head scratching, Gerd asked: | I want to force my Outlook2000 to mark every new calendar...

Shrink Properties
Hi All, I am looking for some help on shrinking & Printing. I have a yearly callendar made on MS Excel which fits on a A4 sheet. I am trying in vain to reduce the document to 55mm x 77mm but at the same time have the 55mm x 77mm callendars across an A4 sheet. I can reduce the document to print to this size by setting the properties to scale it to 32% of original size onto A4 sheet. This is perfect but how can i get the same size callendar so that i will have say 9 per A4 rather than printing 1 per A4 and wasting valuable paper. My printer is an Epson Stylus PHOTO R300 Thanks in advance ...

CRM 1.2: Custom Field with hyphen in name averts default value settings
unfortunately we have customized a lookup-field in crm whose name includes a hyphen months ago. Now this seems to be the reason why it is not possible to change the default value of this lookup. Any experiences with special characters in field names? What can I do now? Is there another reason for my problem with the default values? Any hotfixes? It's a pitty that CRM didn't prohibit the usage of the hyphen on creation of the field, but now months later this error is hard to correct! Had a similar problem with Crystal Reports as well, where a special character in the fieldname averts...

How do I set up messenger in Outlook2003 ?
I followed the on-line help... Tools...Options...Other... checked both boxes at bottom for Name tags etc. Messenger still wont appear. What behavior do you expect from it? The Messenger integration places the Messenger logo in front of the "From" field of received messages and enable you to IM with them when they are online. -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -What do the Outlook Icons Mean? -Create an Office 2003 CD slipstreamed with Service Pack 1 ----- "frustrated 2" <frustrated2@discussions.microsoft.com> wrote in me...