Ribbonbar Systembutton |
Post Reply |
Author | |
JvdH
Groupie Joined: 09 May 2008 Status: Offline Points: 50 |
Post Options
Thanks(0)
Posted: 24 July 2008 at 9:50am |
Hi,
Is there a way to disable that the app closes when doubleclick on the system button, I cannot find a way to disable that.
Thank you :)
|
|
Baldur
Senior Member Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
Post Options
Thanks(0)
|
In VB6 use Form_QueryUnload-Event. |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1354 |
Post Options
Thanks(0)
|
I'm not sure if there's an easier way (I'd like to know if there is), but using the QueryUnload event as Baldur suggests doesn't differentiate between double-clicking the system button and clicking the X button. You can test for the position of the mouse cursor and make sure it is not in the SystemButton area though, so something like this works:
A potential problem with this approach is that the program won't close if the pointer is above the SystemButton and the user press Ctrl+F4 (probably a rare circumstance, but definitely a limitation of this approach...I suppose you could perform a check to see if the Ctrl key is down and if so ignore the pointer position). I'd be happy to be shown an easier way to do this. The only other way I know is to subclass the system button and consume WM_LBUTTONDBLCLK (complicated, but I have an example if you are interested). |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1354 |
Post Options
Thanks(0)
|
I should add, make sure to call Set mobjSysBtn = RibbonBar.AddSystemButton() (or equivalent) to assign the SystemButton to the object reference.
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
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 |