main logo
Subject: Re: Form-specific menus
Author: Bob Archer
Posted: 2001/08/27 12:58:41
 
View Entire Thread
New Search


<i><font color="#663300">I also would like to add/change items to a standard toolbar depending on the form running rather than load a new toolbar I would like to add items by changing button visible property to true/false. How do I reference the toolbar from the form?

</font></i>


You may want to look at the other side of this. Perhaps add a button to the tool bar which makes it self visible when a certain property on the form exists AND is true. Although I would rather just disable it than make it invisible.

For example, lets say you have some forms that have a report tied to them. You could have a property in your form class, lHasReport. You can set it to true for those forms that have a report. You can also have a method in the form PrintReport() which will print the report, perhaps a report name is stored in another form property.

Then, in the toolbar's print button, in the refresh you could put code like...

IF PEMSTATUS(_Screen.ActiveForm,'lHasReport',5) and _Screen.ActiveForm.lHasReport
This.Enabled = .t.
else
This.Enabled = .f.
endif

BOb



 
©2001 Bob Archer
<-- Prior Message New Search Next Message -->