Just add a property to the control:
public partial class MyUserControl : UserControl
{
public string MyProperty { get; set; }
public MyUserControl()
{
InitializeComponent();
}
}
Once you compile it, it will add to the toolbox.
Drop that on your form, and the property will appear in the Property Pane as normal.
Quote:
My question is, in design mode, in property pane of "security level" , instead of int value (0/1), i want to assign "int" type public variable say "user_level"
If that's what you need, then ask for that when you ask a question! :laugh:
It's simple: use an Enum.
public partial class MyUserControl : UserControl
{
public string MyProperty { get; set; }
public enum SecurityLevels
{
User = 0,
Admin = 1,
}
public SecurityLevels SecurityLevel { get; set; }
public MyUserControl()
{
InitializeComponent();
}
}