Context Menu positions |
Post Reply |
Author | |
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
Posted: 20 July 2011 at 4:32am |
Hi all,
I've got a UserControl which is used to show our own Popup menu's within certain screens via either right-click or if placed underneath a button, will show one there. It use to work via a standard inbuilt VB6 Popup Menu as CJ Skinned this nicely and it pops up based on the position within the UserControl top left corner. We recently found an issue with the SkinFramework which skinned the menu nicely, but if the popup menu had a large number of items, the scrolling feature of the menu is lost! I thought of a quick work around (which introduced nicer skinning too) which was to use the CommandBars Context Menus and use a popup from there. The issue I now have though, is the X and Y co-ordinates of ShowPopup method actually are for the position on the screen, rather than within the UserControl's top left corner like the default VB6 one. This is causing me a real pain when trying to show the popup in the correct position. Just in case I'm asked why am I still using this UserControl... simply because due to the vast amount of places it's used and projects it's shared, it's best to keep it here. So... my question is, is there any way I can find the UserControl's position on the screen, or perhaps even get the scrolling working on the old VB6 Menu control when it's skinned? Cheers :)
|
|
Product: Xtreme SuitePro (ActiveX) version 18.5.0
Platform: Windows 7 Enterprise (64-bit) Language: Visual Basic 6.0 |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
I've managed to find my work around by using GetWindowRect() on the Usercontrols' Hwnd to position it in the correct place :)
|
|
Product: Xtreme SuitePro (ActiveX) version 18.5.0
Platform: Windows 7 Enterprise (64-bit) Language: Visual Basic 6.0 |
|
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 |