Nevron Forum

NTabControl mouse events

https://www.nevron.com/Forum/Topic2735.aspx

By Stephen White - Monday, November 9, 2009

I am trying to show an NContextMenu in response to the MouseUp event in the 'button' region of an NTabControl, however mouse events do not appear to fire in this region. Is there some property or method I need to use to get mouse events to fire here, or is this behaviour 'by design'?
By Angel Chorbadzhiev - Monday, November 9, 2009

Hello Stephen,

The NTabControl doesn't handle MouseUp event.

However there is one workaround you can use.

The part of NTabControl where the tabs are actually is NTabStrip control, which handles MouseUp.

This NTabSrtip is not exposed in NTabControl but it is actually the first control in NTabControl.Controls collection, so you can do the following:

NTabStrip tabStrip = nTabControl1.Controls[0] as NTabStrip;

if (tabStrip != null)

{

    tabStrip.MouseUp += new MouseEventHandler(tabStrip_MouseUp);

}

I hope this approach will help you to attach to MouseUp event.

Regards,

Angel.

 

By Stephen White - Monday, November 9, 2009

Hi Angel,

Many thanks for the reply; this is giving me exactly the result I was looking for! Thanks again.

Steve W.