ContextMenu and CompactFrameWork!!!

Hello,

I can add a context menu to any control, like Button, TextBox, TabPage etc; it works all fine but when I add context menu to TabControl it doesnot show up. In my Windows application it works all fine too even on TabControl. Any clue?

Best Regards,

[335 byte] By [RizwanSharp] at [2007-12-25]
# 1

It may be because the TabControl doesn't get the mouse events. You could try this workaround which works for CE devices:-

http://www.peterfoot.net/WindowsMobileContextMenuBehaviourOnWindowsCE.aspx

Alternatively you could place another control over your tab page (e.g. a Panel) and attach the ContextMenu to this

Peter

PeterFoot at 2007-8-31 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 2

Nah, I have already tried this thing, The function in API is handled in Mouse Down Event of any control. Which is not supported by TabControl.

"Alternatively you could place another control over your tab page (e.g. a Panel) and attach the ContextMenu to this"

TabPage is already accepting the ContextMenu and shows it perfect but in Client area of it no on its node. I need to detect it on Node.

By the way, If TabControl has a Property named "ContextMenu" then why it doesnot show up?

In last is there any way to show ContectMenu when we Tap & Hold on a Tab Page's Node? Is there any Global hander like Windows Message like thing in here due to which I can get over all coordinates that where on overall screen it was tapped? and if its has a Tab Page's node under it I may select it and show up the menu.

I'm finding solution for this problem fro about 1 week and no gain at all. I'll really appreciate if someone can help me to solve it.

Thanks again!!!

Best Regards,

RizwanSharp at 2007-8-31 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 3

I don't believe this is possible, even looking at underlying native windows messages on PPC. It appears that on PPC, TabControls don't ever get the NM_RECOGNIZEGESTURE notification. You can look at these two articles for more information on inspecting and responding to windows messages.

timg_msft at 2007-8-31 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 4
How Skype, Inc done it in the Skype Messenger for Pocket PC?

This is the only reason I'm finding answer to my question for last 7 days. Is there any In direct way where i can have something like Windows Messages ? That I tap anywhere in the screen and it should check whtere or not a Tab Head is beneth it and soo on.......

Please...... Try to reply me.

Best Regards,

RizwanSharp at 2007-8-31 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 5
read the two articles referenced in my previous post. They give you everything you need to know about how to go about starting to look at windows messages.
timg_msft at 2007-8-31 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 6

Hmm, Actually I'm really new to Compact Framework, I just saw Skpye Messenger and Its done in there with a great beauty. Anyhow I think to change my though to use something else than TabControl. I'll read articles shortly.

Thanks a lot!

Best Regards,

RizwanSharp at 2007-8-31 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...