Print Page | Close Window

Context Menu positions

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=18692
Printed Date: 05 October 2024 at 11:31pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Context Menu positions
Posted By: Hemesh
Subject: Context Menu positions
Date 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



Replies:
Posted By: Hemesh
Date Posted: 20 July 2011 at 7:38am
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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net