Re: Enumerated List of Formats

Tech-Archive recommends: Speed Up your PC by fixing your registry



The user would be setting a property on my custom textbox user control.

tbCustom.format = "0.0"

This custom textbox has code to perform validation of the text being
entered. It checks for invalid alphanumeric characters, number precision,
max and min value limits. It basically prevents the user from entering an
invalid number in the field and provides user feedback via field flashing
red with bad inputs and tool tips based on Max and Min value limits.

The last thing the control does is set the format to what is desired once
the data entry is complete.

So when I try to create the Enum for format........

Private Enum tbFormat
"0"
"0.0"
"0.#"
etc...
End Enum

VB doesn't take it. I want the "format" property to be of the enum type
tbFormat.

Does this help clear up the question???


Thanks.


"Larry Serflaten" <serflaten@xxxxxxxxxxxxxx> wrote in message
news:OglDoYQbFHA.2768@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Brian" <bkstigler@xxxxxxx> wrote
> > I would like to set up an enumerated list of formats for a user to
select
> > from for a custom textbox control. I can't seem to get it to work. My
list
> > would include things like...
> >
> > "0"
> > "0.0"
> > "0.#"
> > "Scientific" - which I know there is vbScientific
> >
> > etc...
> >
> >
> > Is there a good way to do this??? I thought it would be easy. I must
be
> > missing something.
> >
> > Any help greatly appreciated.
>
>
> What specifically would the user be looking at? A listbox? A Combobox?
> Both of those support text, so where is the problem?
>
> LFS
>


.



Relevant Pages

  • Re: Enumerated List of Formats
    ... > This custom textbox has code to perform validation of the text being ... > The last thing the control does is set the format to what is desired ... > Private Enum tbFormat ... object, or a Dictionary object. ...
    (microsoft.public.vb.general.discussion)
  • Re: Enumerated List of Formats
    ... Enum must be numeric, they cant be strings. ... do you want this functionality to work like the Format ... > The last thing the control does is set the format to what is desired ... > Private Enum tbFormat ...
    (microsoft.public.vb.general.discussion)
  • Re: Integrating Own Control with VS Designer question?
    ... > You also have to declare a property as the shapes enum and in the ... > If you then build your code and drag the control to a form you can ... > Public Sub New ... >> How do I in the designer view make the user ...
    (microsoft.public.dotnet.languages.vb)
  • Re: enumeration and how to populate them during runtime
    ... intellisense access to the valid values for that item. ... the control so I need a way to set that enumeration up during runtime. ... >>Create a class named “clsMyItems” and in that class place an enum. ...
    (microsoft.public.dotnet.languages.vb)
  • Custom Controls having problems with persisting Enums
    ... my custom control instance will lose that property ... Where ListID is actually an enum type. ... Out of the countless newsgroups threads I found on this, ... I think Visual Studio is causing this problem ...
    (microsoft.public.dotnet.languages.csharp)