Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Active control
Message
From
29/10/1998 09:02:17
 
 
To
29/10/1998 08:58:22
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00151923
Message ID:
00152240
Views:
27
>>>>>>Now how do I click on a button on a toolbar and have it do something to the active control? Or maybe "last active" would be more accurate, since the toolbar button would now be the active one.
>>>>>>
>>>>>>Thanks,
>>>>>>
>>>>>>-Michelle
>>>>>
>>>>>You can add
>>>>>Thisform.LastActiveControl=This
>>>>>to each control GotFocus event, or use subclassing here.
>>>>>Don't forget to set This.LastActiveControl=.NULL. in Form.Destroy event
>>>>
>>>>
>>>>So from the toolbar I do _SCREEN.ActiveForm.LastActiveControl.FontBold = .T.?
>>>>
>>>>Or does the toolbar become the active form? I'm sorry if I'm being dense here, but what I really need is the object hierarchy path to the property of the control to put in the CLICK() of the toolbar button.
>>>>
>>>>Thanks,
>>>>
>>>>-Michelle
>>>
>>>You can call ActiveForm, because toolbar doesn't take focus. But for OO sake, try to do it in generic way, i.e. find form you really want to find and provide communication to this form.
>>
>>The form I want to find _is_ the active form so calling ActiveForm seems to be the way to find it. I think I'm missing your point.
>>
>>-Michelle
>
>Ok, use ActiveForm.

LOL! You sound like a parent who's given up trying to explain why the child can't have another cookie. This is starting to become a moot point, anyway. I've got other people busy convincing me I shouldn't use a toolbar at all. I'm leaning towards having it all together in a class, but I've run into a resizing problem as I said in another post.

Still, it's nice to know how to do it with a toolbar, for future reference.

Thanks,

-Michelle
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform