I'm trying to create a UserControl which contains a GroupBox, but I'm running into some designer issues. First, the repro steps:
1. Create a new Class Library project (in C#, VisualStudio 2005)
2. In UserControl1's designer, add a GroupBox
3. Set groupBox1's Dock property to Fill.
4. Build
5. Add a WinForm t the project
6. In Form1's designer, add a UserControl1 control
7. Try to add a Button (or any other control) to userControl11
I've searched on this issue already, and I did find a solution from Rong-Chun Zhang at http://forums.microsoft.com/MSDN/ShowPost.aspx?siteid=1&PostID=2439275, but the problem with this solution is that once the CheckableGroupBox control is added to the WinForm, it can't easily be resized or moved. To do so one needs to:
1. Change the selected item in the properties window from checkableGroupBox1.InternalGroupBx to checkableGroupBox1.
2. The you can resize or move because it is now the user control that has the focus.
If this control was something I was solely going to use by myself that would be fine (though cumbersome), however I plan to release this control to others and I don't like this because:
1. Unless you know this trick, it looks like the designer or the control is broken.
2. It's unintuitive to have to go to the properties window and select the CheckableGroupBox item.
I'm guessing what I need is a custom designer, however, I don't know very much about the Designer classes and haven't found very many articles/tutorial on the subject. (I have found some, though what I've seen isn't applicable to what I'm doing)
Any suggestions?
Thanks,
Jeff