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
792 Views

Similar Articles

[PageSpeed] 41

"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:

File Properties
Is there a way to change the details in the Summary tab of the File Properties dialog box (e.g. Title / Keywords / Comments) through using a macro? Thanks, Andrew activeworkbook.BuiltinDocumentProperties("title") = "Test book" -- HTH RP (remove nothere from the email address if mailing direct) "Andrew" <Andrew@discussions.microsoft.com> wrote in message news:3986D848-BF81-4120-A878-D9B3E80E1A1D@microsoft.com... > Is there a way to change the details in the Summary tab of the File > Properties dialog box (e.g. Title / Keywords / Comments) thr...

shape property based on other shape property
I am documenting the electrical circuits in 90 some labs. I am using Visio 2007. I have created circuit shapes with the Property Types: Circuit ID and Phase. The Circuit Phase can be a number between 1 and 42. The Phase corresponds with that specific number and will be A, B, or C. I want to know how to make the Phase Property be based on the Circuit ID property. Also, there is another type of circuit, where the circuit ID lists two Circuit IDs. Same numbering as before, so an example might look like "2,4". In this case, I would need the Phase Property to be A,B. I fi...

How to create Pivot tables
I am working with an Access 2003 application that contains 6-7 Pivot Tables. The actual database file is in Access 2000 format. I've been tasked with finding a way to save the user's field selections so they can be easily reloaded if and when the database, including the query on which the Pivot Table is built, is refreshed (overwritten). Can anyone in this gorup tell me a) where and how Access stores those settings b) how I can access them to save and reload them Much of the reading I have done always begins with creating a form. These queries are not linked to a form from what I can...

Clearing security settings
I am setting up a new server that will be home to GP version 8. I am migrating from 7.5 to 8. I want to clear out all users, advanced security, and standard security settings and recreate them on the new server. Anybody ever scripted this? I assume I want to truncate tables, but I don't know which ones, other than what is show in techkno Steps to remove Advanced Security (874401). TIA If you run a delete statement on the SY02000 table, it will remove all settings, then you can run a reconcile against security restrictions and user access. "Cindy Lange" wrote: > I...

auto save settings
I have loaded the "auto save" option in the tools menu, but the settings I make revert back to the default settings after every session. Is there a way to make my settings permanent or the default? ...

Changing a forms properties under program control
I have a form caled "frm _Main" and that form has a Sub Form called "frm_Sub_Address" embeded in it. I am wanting to make the "frm_Sub_Address" get its information from two different Tables depending on what info the user wants. The two Tables are called "tbl_Stores" and "tbl_Suppliers". I know that you will raise the question, why do I have 2 tables containing Adddress info but putting that pointy to one side for the moment, my code is as follows, depending on what info the user wants :- iF user wants this info For...

Adding a property sheet to System Properties
Is it possible to add a property sheet to the Windows System Properties dialog? Thanks ...

Make confidential default setting for all e-mails
I work in HR so it would be helpful if all my e-mails went out marked confidential. At the moment I have to set the sensitivity of each e-mail so it would be helpful if Confidential was the default setting for all my e-mail. Is this possible? Rog <Rog@discussions.microsoft.com> wrote: > I work in HR so it would be helpful if all my e-mails went out marked > confidential. At the moment I have to set the sensitivity of each > e-mail so it would be helpful if Confidential was the default setting > for all my e-mail. Is this possible? Perhaps with a custom form. Start ...

can't display address properties
our envirnment is exchange2k3 sp2 and outlook2k3. In outlook,open a message,double click local domain sender/recipient, we can't get address properties,if we double click external domain sender,it's no problem. how do i setup it in exchange server that we can get local domain sender address information? thanks jack ...

How to set custom default OL Email Folders View for 'all' email fo
When I create a new folder the view is never the way I want it... - no groups - no preview - To field visable and before From field So I must manually set this up everytime I create a folder. Is there any way to tell Outlook 2003 that I want ALL email folders to be setup to my custom standard? Thanks for any help. See http://www.outlook-tips.net/howto/grouping.htm -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net EMO - a...

Setting up 2 separate users
Can anyone tell me how to set up 2 separate users on Microsoft money. My boyfriend and I share our computer but want to keep things separate. I have tried, but when I go to download it won't allow me to specify dates, and usually I download his money into mine. Its so weird. Any help is great. Thanks. Best thing is to create two separate files. Use Windows Explorer to navigate to the current MyMoney.mny file and rename it appropriately - HisMoney.mny and then load Money and with File > New create HerMoney.mny. As Money remembers the last file it opened you need to create two d...

Copy outlook setting to new install
Using MS Outlook 2000 (sp2) I've just setup same program on new PC & would like to copy all previous email folders & news folders/news server settings etc... so they look identical. Had a look at Export but doesn't seem to do complete export - is this possible another (easy) way? thanks harry Outlook is not a news reader and therefore never contained any of your newsgroup data. You were most likely using Outlook Express for news. For your email information simply reuse the same PST file your precious installation was using (*.pst). It's where all the mail, calendar...

VBA code to set two different font sizes in a textframe
I'm using Access VBA to build a series of data driven slides, and want the Title in one of the slides to contain a line of text that has font.size = 36, and the font.size on the following like to 18). The code I'm using right now looks like: oShape.TextFrame.TextRange.Font.Size = 36 oShape.TextFrame.TextRange = "First Line" & vbcrlf & "Second line" How can I modify this code to accomplish my goal? ---- Dale On 11/23/09 10:57 AM, in article 6A847D01-8C77-4402-B76A-3DBE4D6FC17D@microsoft.com, "Dale Fye" <dale.fye@nospam.com&g...

Link error invoking a method in another win32 library
Hi all, I am using Visual Studio 2003. The main program is a MFC program and the another one is a win32 library. the libray does not use MFC, but it does use the CStringT class. Some classes in this library have methods using CString as argument. Now if I call these methods in MFC program a link error appears: error LNK2019: unresolved external symbol "public: virtual int __thiscall CSymbolCoder::Encode(char const *,int,int,int,class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > &,class ATL::CStringT<char,class StrTraitMFC<...

How to set my media player as the default player?
I'm writing a media player using vc++ and want to set it as the default player. So that when the user click on a media file, my program will launch as default to do playback. How can I set my media player as the default one? Anything to do with registry? ...

property page
Can anyone point me to some information about using a property page within my project. I want to display data about the MFC document and selected Object to the user so they can view/change them at the same time as looking at the document view. I am using VC++ v6.0 with MFC Any help will be much appreciated Phil >Can anyone point me to some information about using a property page within >my project. Phil, See "Property Sheets and Property Pages" in MSDN. >I want to display data about the MFC document and selected Object to the >user so they can view/change them at...

Publisher and Set Lanuage
When I goto set the lanuage and try to check a document It errors out. Any Suggestions Please e-mail me: friedman@peace-inc.org I have Uninstalled, and Re-Installed twice doesn't work either! Hi David Friedman (anonymous@discussions.microsoft.com), in the Microsoft� newsgroups you posted: || When I goto set the lanuage and try to check a document It || errors out. Any Suggestions Please e-mail me: || friedman@peace-inc.org Set what language, and where? What version of Publisher? What version of Windows? What error message? I won't be emailing you. -- Brian Kvalheim Microsoft ...

Custom document properties
I am using Excel 2003. I read in help that I can link content to custom document properties, but on the custom page of the document properties dialog window the checkbox "Link to content" is grayed out! The file is created, saved and opened. How do I gain access to the "Link to content" feature of the custom document properites? You need to create a name next to the formula bar to link to. I've been searching for this for a while and finally figured it out., Read this doc for more info. http://office.microsoft.com/en-us/assistance/HP052036901033.aspx "...

some user have no mail properties in GAL
After a recent move of all my people to the new ex2k server, I have a few users who have no properties when the GAL entry if viewed from a LAN client. The properties are there in ADUC, but if a user tried to select that person from the gal and send a message it is returned saying that the persone doesn't exist in that organization. When I look at the propertied of that person, in the last tab on the left there is no information there. No SMTP, CCMAIL, X.400 , nothing. Most other users have info there but not these few. It seems to be a local LAN problem. internet mail is not affected. Wher...

How to Set/Change Transparency to CEdit control?
Hi, How to set/change Transparency to Custom Edit control. Can I use SetLayeredWindowAttributes() to set alpha factor for CEdit control? Can I use WS_EX_LAYERED style to child (CEdit) controls? Or should I use GDI+ library feature (Gdiplus::SolidBrush(Gdiplus::Color()). At present both ways are not working for me. Since the edit control is drawn with GDI, invoking a GDI+ mechanism is not going to be terribly successful. While you might consider subclassing the edit control and returning a NULL_BRUSH, this will not produce satisfactory results because edit controls are drawn with SetBkMode(OP...

Setting database location to SQL Server
Hello, I'm looking to move the POS system database from the local MSDE database to a SQL server. I've restored a recent backup (.bck) to a SQL server machine on our network and I'm looking for information on how to reconnect the POS to the new SQL server. Before we go live I will restore a new backup but I'm just testing the solution for now. The overall plan is to separate the database from the cash register and allow SQL server to perform backups and other normal database task. Is there a separate configuration tool for changing data connection information? ...

Project Properties gone blank (Property Pages)
I've just encountered a really weird problem with VS2003. When I pull up the project properties dialog for a project (the dialog that lets you set compiler & linker options) that big white rectangle in the central right which normally lists all the current settings has vanished, leaving a big grey area. There is one exception to this, and that is when I click on the Command Line option under C/C++ or Linker, in which case it displays correctly. I've tried shutting-down the environment and starting fresh, without change, and it does this with any project I load. This is particul...

How Do I Set Up Two Profiles in Outlook 2002
I'm trying to have Contacts & Calender for two different users under one Windows XP ID. Don't use Outlook for e-mail. This is for synching with cell phones. I tried setting up a new Outlook Data File (.pst), that didn't work. Tried setting up a new Profile, that didn't do what I wanted either. When I set up a new Profile, I did it with the copy old Profile to new Profile function. Then to test, I added a Contact or Calender entry in one Profile, but presumably it should not have appeared in other Profile, but it always does. ...

Security setting to case
I have two users (A & B) in two BUs. User B is not allowed to see the case records created and owned by user A. However, in my system user B can see few records of User A. I'd checked the record's owner and the sharing right and they were all right. What can I check and fix? ...

How do I change the properties of specific points in a scatter plo
....more specifically, I have been creating elevation profiles of state park trails and have been changing the points that coincide with intersections to large circles while leaving the rest of the data series unchanged. Hovering over the line with a pointer until I locate the precise point, and then manually changing it's properties is becoming very time comsuming. Is there a way I can automate the process, or at least do multilple points at once?? If I understand the problem correctly, here is a suggestion: use a second series for the intersections Let's say the distance val...