Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disabling a button contained in a class

Status
Not open for further replies.

R17

Programmer
Jan 20, 2003
267
PH

i have a class for my buttons named "mybutton1". this class has a command group named mybutton. i put this class inside a form named myformbase1 which is also a class based on form.

i want a button in my button to be disabled when my form is loaded. i use "thisform.cmdButton1.Enabled=.F."

an error occurs, "unknown member CMDBUTTON1".

what should i do?
 
When (which event) you wrote this command ?
Now VFP don't create this button yet.
You can do disable cmdButton1 in form designing and in event (when you want) you change it

Monika from Warszawa (Poland)
(monikai@yahoo.com)
 
Put the code in the Init event, not in Load event.
Good luck!

 
R17

You have a control, (.cmdButton1), inside a container, (mybutton), inside a form (THISFORM), so the code would be:-

THISFORM.mybutton.cmdButton1.Enabled = .F.

To conform with Hungarian notation, you should rename 'mybutton' to 'cmgMyButton', where the prefix 'cmg' identifies the container as a command group.

As csandu00 hs suggested, put the code in the .Init() event of the form.


FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top