Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Context Menu positions
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Context Menu positions

 Post Reply Post Reply
Author
Message
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post Topic: Context Menu positions
    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
Back to Top
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.