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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable buttons on the toolbar! 1

Status
Not open for further replies.

MrProgrammer

Programmer
Feb 1, 2002
41
TR
I have a toolbar on the main window (MDI form) and there is a button on this toolbar. When user clicks the button, a child window will be shown and the button will be disabled.
I did this part. But when that child window closed, the button on the toolbar must be enabled. I tried to enable it in the "Close Event" of the child window but I'm getting an error message like "Unknown identifier ?Button14".
How can I access a button on the toolbar from a child window?
 
Try placing the code on an embed point from the button on the main menu. You place it there after the code to pull up the child, then when it returns from the child it will execute this code.
 
Well, you must to try SETTARGET.

something like

SETTARGET(,1)
0{PROP:STATUSTEXT,1} = 'Change the status text'
SETTARGET

As you know, the FEQ number, is assigned at every control into the window, where 0 always is the windows itself, every control after will be a number (FEQ).

vrg: A Window with an OK and an CANCEL button:
Windows will be 0
IF "TAB" order is OK then CANCEL button:
OK button will be 1
CANCEL button will be 2

so you can change the text to button CANCEL this way:
2{PROP:TEXT} = 'CANCELAR'

and change to flat the OK button:
1{PROP:FLAT} = TRUE

finally change the icon to the window:
0{PROP:ICON} = ICON:pRINT

So, you can disable control from every window, by just knowing the thread number of the window, and the FEQ of the control.
You can put something like this on your tool's bar button to know it's FEQ

MESSAGE(?{PROP:USE,2})

ALWAYS on MDI the Main Windows has the Thread No. 1

You code should be like:

SETTARGET(,1)
ButtonFEQ{PROP:DISABLE} = FALSE
SETTARGET

Saludos, Cabrón!.
-----
carabez@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top