UserControl like in TaskPane of MyComputer
-
Hello I'm developing a UserControl like you can see in TaskPane of "My computer". For this i used GroupBox with Label control and some effects to expanding and collapsing it. Then when i used this usercontrol in one windows project, I couldn't add controls to it! I want to add controls like button from toolbox to it in design time by drag-n-drop. Regards
-
Hello I'm developing a UserControl like you can see in TaskPane of "My computer". For this i used GroupBox with Label control and some effects to expanding and collapsing it. Then when i used this usercontrol in one windows project, I couldn't add controls to it! I want to add controls like button from toolbox to it in design time by drag-n-drop. Regards
I solved My problem : Here is some links contains samples about this subject : http://www.codeproject.com/cs/miscctrl/xpgroupbox.asp[^] ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.KB.v10.en/enu_kbvcsharpnetkb/vcsharpnetkb/813450.htm And my code :
using System.ComponentModel.Design; namespace TaskPanel { [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); this.ControlAdded += new ControlEventHandler(UserControl1_ControlAdded); } private void UserControl1_ControlAdded(object sender, ControlEventArgs e) { e.Control.BringToFront(); } } }