开发者

How do I create frames/tabs in C# Windows Forms?

开发者 https://www.devze.com 2023-04-12 11:37 出处:网络
I know there is a tab control in the Windows Forms Builder. The thing is, I want to create something a little nicer. It seems like ther开发者_JAVA百科e\'s not many stylistic changes you can make to th

I know there is a tab control in the Windows Forms Builder. The thing is, I want to create something a little nicer. It seems like ther开发者_JAVA百科e's not many stylistic changes you can make to that control in specific, and it looks kind of ugly.

Is there either a way of creating a custom tab control, or using buttons to switch from pane to pane?


To change the Tabcontrol to use button to switch the tab pages, use below code:

 this.tabControl1.Appearance = TabAppearance.Buttons;


The TabControl has a DrawMode property. Change it to:

tabControl1.DrawMode = OwnerDrawFixed;

and then wire up the DrawItem event. Of course, then you have to draw the rest yourself to your own liking.

If you are looking for something more, DevExpress has free WinForm controls, which includes their TabControl version.


I've used DockPanel Suite for this sort of thing before and just not used all the tool window stuff.

0

精彩评论

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

关注公众号