Tabless tab control to emulate java's Card Layout Manager
I want to emulate java's card Layout Manager in C#. From what I can tell, with out buying 3rd party software, the easiest way to do this is with a tab control that I set up each tab as I see fit with components and then in the TabControl properties window set:
TabControl.Appearance = Buttons
TabControl.SizeMode = Fixed
TabControl.ItemSize = 0,1
TabControl.Alignment = Top
This will give me a "tabless" tab control (tab control with out any tabs). This will allow me to control the order in which the user "flips" through the different tabs.
This works, but anytime I use a control in a non standard way, I feel that it is hacky and prone to problems. Is开发者_开发百科 this a good way to go about this, or is this "Amature C# GUI developement hour" material?
Thanks
See here: http://www.vbforums.com/showthread.php?t=558143 for a pre-built tabless tab control. It's in VB.NET but there are plenty of converters and you could also compile it if you have a VB.NET compiler.
My first reaction is, "if the properties are there for you to change, then change them". You are not hacking into anything to change functionality - you are modifying functionality using the provided public properties.
The only thing I would recommend is to create a UserControl
to encapsulate your custom tabless TabControl. Otherwise, if the changes you propose will provide you with the emulated functionality you need, then it's a good way to do it. Nothing about your changes seem 'hackish' or in bad form.
Edit
Based on @Henk's comment: I don't feel it is hackish to customize an existing control to a point. I hadn't thought of the side effects of something like Ctrl+Tab. If you have to start writing work-arounds to deal with existing functionality, then it is probably time to look for another control (such as @minitech links to, very nice BTW), or open up VS, create a new UserControl and start to work. Often, though, you will find a control to fit your needs.
you can use cardlayout component from Syncfusion controls package for more information check this address :
http://help.syncfusion.com/cr/cref_files/asp.net%20mvc/chart/html/177b5fe2-fa6d-061d-5cc3-18048081a494.htm
although this package is not free but can be usefull for professional programming
精彩评论