need feedback on what control this is...
In the visual studio toolbox, all controls are grouped. And you can hide/show certain areas by headers. What control gives similar functionality in my own program? I would like to let the user control what they see on screen. It would be better if the sub-areas could contain text boxes for data entry.
I played around with a treeview but it doesn't seem to be the same. For example i was unable to put the plus on the label itself instead of beside it.
Re: need feedback on what control this is...
Create a custom control that inherits from the UserControl class. Then you can override the OnMouseClick event so that when the top area of the panel is clicked, the panel reduces in size, so only that top area of the panel is shown. Use a Boolean value to store whether the Panel is "expanded" or "collapsed".
When you "collapse" the Panel, first store it's Height in a variable (lets call is iExpandedHeight), then change the Panel's Height to, say, 32. Then when you "expand" the panel, simply change the Panel's Height to whatever was stored in the iExpandedHeight variable.
You can then use custom painting to render the top section of the Panel in a different colour to the rest of it, and even paint a plus/minus sign here too.
When you dock the Panel in a Form, any other Panel's you dock underneath it will move to take up space used by the previous Panel when it is collapsed, and move to allow more room when you expand the previous Panel.
You can then place any controls you like inside these Panels, like TextBoxes for example.
1 Attachment(s)
Re: need feedback on what control this is...
Here's an example of the basic mechanics of the control...
I've left the OnPaint method blank as this is pretty self-explanatory (this is where you paint the header in a different color and where you draw the plus or minus sign).
Re: need feedback on what control this is...
HMM well that looks right but i was hoping it would be somethign i could use at design time. I've never compiled a user control before. Could i add controls at design time with a compiled version of that?
Re: need feedback on what control this is...
You would have to build upon the example and add a collection class of panels or something so that you could add new items to the collection at run time or in the IDE in your project.
New controls in the VS IDE are not always released for developers to use. Look at the PropertyGrid control. It wasnt made available until .NET after all those years in classic vb.
Re: need feedback on what control this is...
Actually if you use WPF, you could group an amount of expander controls into a panel and bobs your father.
Re: need feedback on what control this is...
any rumors of a service pack for 2008? I am about to go back to 2005. About once every 2 days it seems, i have some kind of issue. Check the game project i am working on in my profile link. Now it's giving me unfound schema warnings. Before that (and a project restore) it was claiming i was declaring my form twice (from IDE-Created code)
Re: need feedback on what control this is...
Might want this as a new thread. ;)
SP-1 is still in beta but you can download it here -> http://www.microsoft.com/downloads/d...displaylang=en
Re: need feedback on what control this is...
Quote:
control improvements such as the DataRepeater for Windows Forms and Office 2007 Ribbons
Oooh that's going to put some custom control designers out of business (Well, the bad ones who rely on only that anyway).
Re: need feedback on what control this is...
Yea but I have only seen 2 really good ones and they were hundreds of dollars. All the others are usually really crappy way off "copies".
Should be some time in the next month or three that SP-1 goes RTM. I wont install the Beta as its a beta and I dont want all the headaches from trying to uninstall a beta and cleaning it up etc.