Strange ContextMenu Behavior in TabControl and TabPages

0
0

Dear WiseJ team,

Here is a test application with TabControl and 3 TabPages:
– tabControl has a ContextMenu
– tabPage1 does not have ContextMenu (ContextMenu=null)
– tabPage2 has its own ContextMenu (not empty)
– tabPage3 has its own ContextMenu (empty)

Finally I need ContextMenu just for right clicking on the tab, but not inside the tub.
As you see in example:
– if tab has no ContextMenu – the tabControls ContextMenu is activated on right click
– if tab has its own ContextMenu – its ContextMenu is activated on right click
– if tab has empty ContextMenu – the strange empty rectangle is activated on right click

Could you check please this example and suggest the solution?

Kind regards,
Dmitry

  • You must to post comments
0
0

I think the first enhancement should be:
– The TabControl.ContextMenu and TabPage.ContextMenu show be assigned to the tab button, not the page.

Kind regards,
Dmiyry

  • You must to post comments
0
0

OK. Looks like we have two enhancements:

  • The TabPage.ContextMenu show be assigned to the tab button, not the page.
  • When a ContextMenu is empty it shouldn’t show, but should still process the contextmenu event.
  • You must to post comments
0
0

Hello Luca,

  1. The ContextMenu assigned to the TabControl shows when you right click anywhere on the TabControl, including the tab strip and outside of the tab buttons but within the TabControl rectangle. Which is correct.
    Yes, that is correct. But how can I allow ContextMenu to be showed when you right click on the tub buttons only, not on the tabPage? That was the question.
  2. The ContextMenu assigned to a TabPage shows when you right click on the page (not the tab button). Which is as designed – but I’m thinking that it should show when right clicking on the tab button. Is this the issue?
    Yes, I think it must be shown only when you click on the tab button, but not on the tabPage.
  3. An empty context menu shows as an empty menu. You have to set it to null. I have to see if we can avoid showing the empty menu.
    If I set it to null, the ContextMenu from tabControl will be showed on the tabPage, but I don’t need that. I need switch off ContextMenu inside the tabPage.

With the current behaviour of ContextMenu for tabControl there is no possibility to use native browser’s right click reaction in any controls inside the tabPage.

Kind regards,

Dmitry

 

  • You must to post comments
0
0

This is what’s happening:

  • The ContextMenu assigned to the TabControl shows when you right click anywhere on the TabControl, including the tab strip and outside of the tab buttons but within the TabControl rectangle. Which is correct.
  • The ContextMenu assigned to a TabPage shows when you right click on the page (not the tab button). Which is as designed – but I’m thinking that it should show when right clicking on the tab button. Is this the issue?
  • An empty context menu shows as an empty menu. You have to set it to null. I have to see if we can avoid showing the empty menu.

 

  • Luca (ITG)
    Forgot to add the the context menu shows also on a longtap event.
  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.