instead of using a public variable, use a public property
private book _canDropDown;
public bool CanDropDown
{
get
{
return _canDropDown;
}
set
{
// Set the internal value
_canDropDown = value;
// If the internal value if false, disable the dropdown
if (_canDropDown == false)
{
this.Enabled = false;
}
else
{
this.Enabled = true;
}
}
}
--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Mihaly" <Mi****@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
Example:
public class MyComboBox : System.Windows.Forms.ComboBox;
{
public bool CanDropDown = true;
public MyComboBox()
{
}
}
Prease help me how modify this class for if CanDropDown = false, the
user can not open the drop down list of the combobox.
I do'nt want to use the Enabled propertie.
Thank you!