Does someone know how I could extend and TabPag开发者_JS百科e 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
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.
精彩评论