Modeless form toolstrip buttons need additional click

archie456

Member
Joined
Apr 19, 2020
Messages
11
Programming Experience
1-3
Hi,


I've created a C# addon for Autodesk Revit which displays a modeless form that has various buttons on it to run certain commands.

This works well, but I've now discovered tool strips (I'm new to c# and windows forms). I've now removed the buttons from the form and used a toolstrip with buttons - this looks much cleaner.

But I've now noticed a strange effect. When had buttons on the form, I could click on them and they would work even though the focus would on Autodesk Revit and no my modeless form.

But now I have a tool strip, the buttons don't work unless the form has the focus, so in effect I need to click them twice - once to gain focus and again to operate them.

Is there any way I can change this operation and make the buttons on the toolstrip always work on first click?



Thanks.
 
Basically you are running into something that is the default behavior of the Win32 API toolstrip item. You'll need to workaround it. See:
 
Back
Top Bottom