Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
Mouse click event for the Tabs in TabGroupPane
posted

Hello

Is there a way I can set up a mouse click event for the tabs on the TabGroupPane which will execute a code behind.

Thanks

Manoj Reddy Palle

Parents
  • 35319
    Verified Answer
    posted

    Hello,

     

    I have been looking into your issue and I can suggest you use an event setter. If you want to read detailed information about event setters, you can open the following MSDN link :

     

    http://msdn.microsoft.com/en-us/library/system.windows.eventsetter.aspx

     

    As you can see an event setter is used in a style definition. In our case the target type of the style is ‘PaneTabItem’ and the most appropriate event I could think of is ‘PreviewMouseLeftButtonDown’. You can also use the MouseLeftButtonUp , MouseDown, MouseRightButtonDown or another one that best meets your needs.

     

    For example :

     

    <Style TargetType="{x:Type igDock:PaneTabItem}">

                    <EventSetter Event="PreviewMouseLeftButtonDown" Handler="MyHandler"/>

    </Style>

     

     

     void MyHandler(object sender, MouseButtonEventArgs e)

            {

                // here you can add the desired functionality that will be executed when you click a tab

            }

     

    If you require any further assistance please do not hesitate to ask.

Reply Children
No Data