开发者

How to make an Firefox like tabcontrol in c sharp?

开发者 https://www.devze.com 2023-01-03 14:59 出处:网络
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 ?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消