RibbonBar Systembutton |
Post Reply |
Author | |
moe188
Senior Member Joined: 27 March 2006 Status: Offline Points: 220 |
Post Options
Thanks(0)
Posted: 27 February 2010 at 4:32pm |
Hello,
I am adding a RibbonBar SystemButton to my form, but without any submenu, and I want the form to close once the user clicks the SystemButton. How can I do this?
Thank you
|
|
Visual Baisc 6 SP6
Windows XP Pro Sp3, Windows 7 Codejock Xtreme SuitePro ActiveX 15.1.3 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
This turns out to be a bit trickier than you might expect for a couple of reasons:
1) Clicking the System Button doesn't fire the Execute event, so you can't test for it there. 2) You can test for the System Button in the InitCommandsPopup event, but if you call Unload Me in that event then the IDE (and likely compiled EXE) will crash. Fortunately, you can safely use the PostMessage API with WM_CLOSE on the form hWnd to close the window in the InitCommandsPopup event. The following code works in my limited testing (assuming a form with a command bars control named CommandBars1):
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
moe188
Senior Member Joined: 27 March 2006 Status: Offline Points: 220 |
Post Options
Thanks(0)
|
Thank you it works fine
|
|
Visual Baisc 6 SP6
Windows XP Pro Sp3, Windows 7 Codejock Xtreme SuitePro ActiveX 15.1.3 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |