Does someone know how I could extend and TabPage so that there is a X visible on an active tab, that when pressed, closes the tab /ask if the tab should be closed ?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the TabControl.DrawMode property to implement custom drawing. There’s a good example of a DrawItem event handler in the MSDN Library article. Use Graphics.DrawLine() or DrawImage to draw the x. Use the MouseUp event to detect a click on the x. You’ll need the GetTabRect() method to find out which tab was clicked. And narrow down the location to verify that it was near the x.