Peter,
Thanks for your help, but I'm still missing something.
I take it that I am to create 2 properties, one for noLetters and one for
noDigits, and assign the first one the value InputStyle.noLetters and the
other InputStyle.noDigits.
public enum InputStyle
{
noDigits,
noLetters
}
private InputStyle myEnum = TestEnum.noDigits;
private InputStyle myOtherEnum = TestEnum.noLetters;
[Browsable(true)]
public InputStyle MyProperty
{
get { return noLetters; }
set {noLetters = value; }
}
[Browsable(true)]
public InputStyle MyOtherProperty
{
get { return noDigits; }
set {noDigits = value; }
}
Doing that creates 2 properties with a drop down box with both choices.
I need to be able to create one property called InputStyle and have the
dropdown box offer the choices to the programmer.
I've played around with it a bit but can't get that functionality. Any
help
on that point would be most appreciated.
Alan
Peter Jausovec said:
Little error -- here's the correct code:
Browsable(true)]
public TestEnum MyProperty
{
get { return myEnum; }
set {myEnum = value; }
}
--
Regards,
Peter Jausovec
(
http://blog.jausovec.net)
I want to select the input style for my custom textbox to accept either
only
letters, or digits, or both, as chosen at design time. How do I create
an
enumeration that appears in the properties window so that I can select
the
input style for different scenarios?
I'm fairly new to programming so any sample code would be most
appreciated.