Mờ ảo quá, hiểu chết liền
em tạo 1 cái User Control nhưng muốn cài propertise của User Control đó giống ComboBox
(VD: chỉ cho lựa chọn 1 trong 5 loại). Nó giống như thuộc tính Dock, Enabled,... của các Control chỉ cho chọn 1 trong nhiều cái
Mờ ảo quá, hiểu chết liền
là em muốn tq5o 1 thuộc tính của User Control có dạng như thế này
Bạn tham khảo cái này nhe, tạo UserControl1, tạo enum myEnumList, khai báo myEnumList ChoosenMember, tạo property A
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
public myEnumList A
{
get
{
return ChoosenMember;
}
set
{
ChoosenMember = value;
}
}
public enum myEnumList
{
member0,
member1,
member2
};
private myEnumList ChoosenMember;
}