|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Newbie questionI have been trying to lear vb.net and I cannot remeber how to do
something that I read about a week ago and it is trying me crazy You now how if you creat a vriable that is boolean whe you type in X = the tru or false choice comes up. I want to creat a variable that is a string but can only exsit in three states top middle and bottom. I forgot how to do it. Sorry for this stupid question Public Enum CurrentState
top middle bottom End Enum Public x As CurrentState x = (you will get the intellisense dropdown here) <New***@gmail.com> wrote in message Show quoteHide quote news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... >I have been trying to lear vb.net and I cannot remeber how to do > something that I read about a week ago and it is trying me crazy > > You now how if you creat a vriable that is boolean whe you type in X > = the tru or false choice comes up. I want to creat a variable that > is a string but can only exsit in three states top middle and bottom. > I forgot how to do it. Sorry for this stupid question Thanks that helps a lot. Is there any way to do it as a string
instead of an integer? Show quoteHide quote On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> wrote: >Public Enum CurrentState > top > middle > bottom >End Enum > >Public x As CurrentState >x = (you will get the intellisense dropdown here) > > ><New***@gmail.com> wrote in message >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... >>I have been trying to lear vb.net and I cannot remeber how to do >> something that I read about a week ago and it is trying me crazy >> >> You now how if you creat a vriable that is boolean whe you type in X >> = the tru or false choice comes up. I want to creat a variable that >> is a string but can only exsit in three states top middle and bottom. >> I forgot how to do it. Sorry for this stupid question > Can you give us a sample, in my idea is Scott's answer exact the answer on
your question. Cor <New***@gmail.com> schreef in bericht Show quoteHide quote news:j8tjo2dd6tot24p9q6hk5q1mrer5hf5f96@4ax.com... > Thanks that helps a lot. Is there any way to do it as a string > instead of an integer? > On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> > wrote: > >>Public Enum CurrentState >> top >> middle >> bottom >>End Enum >> >>Public x As CurrentState >>x = (you will get the intellisense dropdown here) >> >> >><New***@gmail.com> wrote in message >>news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... >>>I have been trying to lear vb.net and I cannot remeber how to do >>> something that I read about a week ago and it is trying me crazy >>> >>> You now how if you creat a vriable that is boolean whe you type in X >>> = the tru or false choice comes up. I want to creat a variable that >>> is a string but can only exsit in three states top middle and bottom. >>> I forgot how to do it. Sorry for this stupid question >> > Hi Aaron
Try this..... Public Class MyClass Public Enum MyEnum Dog Cat Pig End Enum Private _Animal As MyEnum <Category("My Category"), DefaultValue(GetType(MyEnum), "Dog")> _ Property [Animal]() As MyEnum Get Return _Animal End Get Set(ByVal Value As MyEnum) _Animal = Value End Set End Property ' ******************** ' To grab it after at runtime.... ' If Animal = MyEnum.Dog then ' ' End If End Class The Grand Master New***@gmail.com wrote: Show quoteHide quote > Thanks that helps a lot. Is there any way to do it as a string > instead of an integer? > On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> > wrote: > > >Public Enum CurrentState > > top > > middle > > bottom > >End Enum > > > >Public x As CurrentState > >x = (you will get the intellisense dropdown here) > > > > > ><New***@gmail.com> wrote in message > >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... > >>I have been trying to lear vb.net and I cannot remeber how to do > >> something that I read about a week ago and it is trying me crazy > >> > >> You now how if you creat a vriable that is boolean whe you type in X > >> = the tru or false choice comes up. I want to creat a variable that > >> is a string but can only exsit in three states top middle and bottom. > >> I forgot how to do it. Sorry for this stupid question > > I don't know how this address the string question, but no Aaron, Strings are
not allowed as enum types. You could, of course, write your own case statement (if there aren't a lot of Enum choices) to test an Enum value and assign a different variable according to that Enum value. Show quoteHide quote "Master Programmer" <master_program***@outgun.com> wrote in message news:1166694011.048266.48540@i12g2000cwa.googlegroups.com... > Hi Aaron > > Try this..... > > Public Class MyClass > > Public Enum MyEnum > Dog > Cat > Pig > End Enum > > Private _Animal As MyEnum > > > <Category("My Category"), DefaultValue(GetType(MyEnum), "Dog")> _ > Property [Animal]() As MyEnum > Get > Return _Animal > End Get > Set(ByVal Value As MyEnum) > _Animal = Value > End Set > End Property > > > ' ******************** > ' To grab it after at runtime.... > > ' If Animal = MyEnum.Dog then > ' > ' End If > > > End Class > > > The Grand Master > > > > New***@gmail.com wrote: >> Thanks that helps a lot. Is there any way to do it as a string >> instead of an integer? >> On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> >> wrote: >> >> >Public Enum CurrentState >> > top >> > middle >> > bottom >> >End Enum >> > >> >Public x As CurrentState >> >x = (you will get the intellisense dropdown here) >> > >> > >> ><New***@gmail.com> wrote in message >> >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... >> >>I have been trying to lear vb.net and I cannot remeber how to do >> >> something that I read about a week ago and it is trying me crazy >> >> >> >> You now how if you creat a vriable that is boolean whe you type in X >> >> = the tru or false choice comes up. I want to creat a variable that >> >> is a string but can only exsit in three states top middle and bottom. >> >> I forgot how to do it. Sorry for this stupid question >> > > If you tried to run my code you stupid c**t, then you would see that it
works just fine. The Grand Master Scott M. wrote: Show quoteHide quote > I don't know how this address the string question, but no Aaron, Strings are > not allowed as enum types. You could, of course, write your own case > statement (if there aren't a lot of Enum choices) to test an Enum value and > assign a different variable according to that Enum value. > > > "Master Programmer" <master_program***@outgun.com> wrote in message > news:1166694011.048266.48540@i12g2000cwa.googlegroups.com... > > Hi Aaron > > > > Try this..... > > > > Public Class MyClass > > > > Public Enum MyEnum > > Dog > > Cat > > Pig > > End Enum > > > > Private _Animal As MyEnum > > > > > > <Category("My Category"), DefaultValue(GetType(MyEnum), "Dog")> _ > > Property [Animal]() As MyEnum > > Get > > Return _Animal > > End Get > > Set(ByVal Value As MyEnum) > > _Animal = Value > > End Set > > End Property > > > > > > ' ******************** > > ' To grab it after at runtime.... > > > > ' If Animal = MyEnum.Dog then > > ' > > ' End If > > > > > > End Class > > > > > > The Grand Master > > > > > > > > New***@gmail.com wrote: > >> Thanks that helps a lot. Is there any way to do it as a string > >> instead of an integer? > >> On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> > >> wrote: > >> > >> >Public Enum CurrentState > >> > top > >> > middle > >> > bottom > >> >End Enum > >> > > >> >Public x As CurrentState > >> >x = (you will get the intellisense dropdown here) > >> > > >> > > >> ><New***@gmail.com> wrote in message > >> >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... > >> >>I have been trying to lear vb.net and I cannot remeber how to do > >> >> something that I read about a week ago and it is trying me crazy > >> >> > >> >> You now how if you creat a vriable that is boolean whe you type in X > >> >> = the tru or false choice comes up. I want to creat a variable that > >> >> is a string but can only exsit in three states top middle and bottom. > >> >> I forgot how to do it. Sorry for this stupid question > >> > > > Forwarded to groups-ab***@google.com
Show quoteHide quote "Master Programmer" <master_program***@outgun.com> wrote in message news:1166747738.978181.108510@n67g2000cwd.googlegroups.com... > If you tried to run my code you stupid c**t, then you would see that it > works just fine. > > The Grand Master > > Scott M. wrote: >> I don't know how this address the string question, but no Aaron, Strings >> are >> not allowed as enum types. You could, of course, write your own case >> statement (if there aren't a lot of Enum choices) to test an Enum value >> and >> assign a different variable according to that Enum value. >> >> >> "Master Programmer" <master_program***@outgun.com> wrote in message >> news:1166694011.048266.48540@i12g2000cwa.googlegroups.com... >> > Hi Aaron >> > >> > Try this..... >> > >> > Public Class MyClass >> > >> > Public Enum MyEnum >> > Dog >> > Cat >> > Pig >> > End Enum >> > >> > Private _Animal As MyEnum >> > >> > >> > <Category("My Category"), DefaultValue(GetType(MyEnum), "Dog")> _ >> > Property [Animal]() As MyEnum >> > Get >> > Return _Animal >> > End Get >> > Set(ByVal Value As MyEnum) >> > _Animal = Value >> > End Set >> > End Property >> > >> > >> > ' ******************** >> > ' To grab it after at runtime.... >> > >> > ' If Animal = MyEnum.Dog then >> > ' >> > ' End If >> > >> > >> > End Class >> > >> > >> > The Grand Master >> > >> > >> > >> > New***@gmail.com wrote: >> >> Thanks that helps a lot. Is there any way to do it as a string >> >> instead of an integer? >> >> On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> >> >> wrote: >> >> >> >> >Public Enum CurrentState >> >> > top >> >> > middle >> >> > bottom >> >> >End Enum >> >> > >> >> >Public x As CurrentState >> >> >x = (you will get the intellisense dropdown here) >> >> > >> >> > >> >> ><New***@gmail.com> wrote in message >> >> >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... >> >> >>I have been trying to lear vb.net and I cannot remeber how to do >> >> >> something that I read about a week ago and it is trying me crazy >> >> >> >> >> >> You now how if you creat a vriable that is boolean whe you type in >> >> >> X >> >> >> = the tru or false choice comes up. I want to creat a variable >> >> >> that >> >> >> is a string but can only exsit in three states top middle and >> >> >> bottom. >> >> >> I forgot how to do it. Sorry for this stupid question >> >> > >> > > Oh, I like that. I filled out a report about him on
the Google website, but it doesn't seem to have helped. Yet. Robin S. ------------------------------------- Show quoteHide quote "Stephany Young" <noone@localhost> wrote in message news:%23ith7wWJHHA.1248@TK2MSFTNGP03.phx.gbl... > Forwarded to groups-ab***@google.com > > > "Master Programmer" <master_program***@outgun.com> wrote in message > news:1166747738.978181.108510@n67g2000cwd.googlegroups.com... >> If you tried to run my code you stupid c**t, then you would see that >> it >> works just fine. >> >> The Grand Master >> >> Scott M. wrote: >>> I don't know how this address the string question, but no Aaron, >>> Strings are >>> not allowed as enum types. You could, of course, write your own >>> case >>> statement (if there aren't a lot of Enum choices) to test an Enum >>> value and >>> assign a different variable according to that Enum value. >>> >>> >>> "Master Programmer" <master_program***@outgun.com> wrote in message >>> news:1166694011.048266.48540@i12g2000cwa.googlegroups.com... >>> > Hi Aaron >>> > >>> > Try this..... >>> > >>> > Public Class MyClass >>> > >>> > Public Enum MyEnum >>> > Dog >>> > Cat >>> > Pig >>> > End Enum >>> > >>> > Private _Animal As MyEnum >>> > >>> > >>> > <Category("My Category"), DefaultValue(GetType(MyEnum), "Dog")> >>> > _ >>> > Property [Animal]() As MyEnum >>> > Get >>> > Return _Animal >>> > End Get >>> > Set(ByVal Value As MyEnum) >>> > _Animal = Value >>> > End Set >>> > End Property >>> > >>> > >>> > ' ******************** >>> > ' To grab it after at runtime.... >>> > >>> > ' If Animal = MyEnum.Dog then >>> > ' >>> > ' End If >>> > >>> > >>> > End Class >>> > >>> > >>> > The Grand Master >>> > >>> > >>> > >>> > New***@gmail.com wrote: >>> >> Thanks that helps a lot. Is there any way to do it as a string >>> >> instead of an integer? >>> >> On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." >>> >> <s-mar@nospam.nospam> >>> >> wrote: >>> >> >>> >> >Public Enum CurrentState >>> >> > top >>> >> > middle >>> >> > bottom >>> >> >End Enum >>> >> > >>> >> >Public x As CurrentState >>> >> >x = (you will get the intellisense dropdown here) >>> >> > >>> >> > >>> >> ><New***@gmail.com> wrote in message >>> >> >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... >>> >> >>I have been trying to lear vb.net and I cannot remeber how to >>> >> >>do >>> >> >> something that I read about a week ago and it is trying me >>> >> >> crazy >>> >> >> >>> >> >> You now how if you creat a vriable that is boolean whe you >>> >> >> type in X >>> >> >> = the tru or false choice comes up. I want to creat a >>> >> >> variable that >>> >> >> is a string but can only exsit in three states top middle and >>> >> >> bottom. >>> >> >> I forgot how to do it. Sorry for this stupid question >>> >> > >>> > >> > > What a idiot you are to speak the way you do. Someone who isn't an expert
is asking questions and you stoop so low. I hope you don't have a wife.... If you do she most likely has called or should call the abuse hotline to get away from someone like you. Show quoteHide quote "Master Programmer" <master_program***@outgun.com> wrote in message news:1166747738.978181.108510@n67g2000cwd.googlegroups.com... > If you tried to run my code you stupid c**t, then you would see that it > works just fine. > > The Grand Master > > Scott M. wrote: >> I don't know how this address the string question, but no Aaron, Strings >> are >> not allowed as enum types. You could, of course, write your own case >> statement (if there aren't a lot of Enum choices) to test an Enum value >> and >> assign a different variable according to that Enum value. >> >> >> "Master Programmer" <master_program***@outgun.com> wrote in message >> news:1166694011.048266.48540@i12g2000cwa.googlegroups.com... >> > Hi Aaron >> > >> > Try this..... >> > >> > Public Class MyClass >> > >> > Public Enum MyEnum >> > Dog >> > Cat >> > Pig >> > End Enum >> > >> > Private _Animal As MyEnum >> > >> > >> > <Category("My Category"), DefaultValue(GetType(MyEnum), "Dog")> _ >> > Property [Animal]() As MyEnum >> > Get >> > Return _Animal >> > End Get >> > Set(ByVal Value As MyEnum) >> > _Animal = Value >> > End Set >> > End Property >> > >> > >> > ' ******************** >> > ' To grab it after at runtime.... >> > >> > ' If Animal = MyEnum.Dog then >> > ' >> > ' End If >> > >> > >> > End Class >> > >> > >> > The Grand Master >> > >> > >> > >> > New***@gmail.com wrote: >> >> Thanks that helps a lot. Is there any way to do it as a string >> >> instead of an integer? >> >> On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> >> >> wrote: >> >> >> >> >Public Enum CurrentState >> >> > top >> >> > middle >> >> > bottom >> >> >End Enum >> >> > >> >> >Public x As CurrentState >> >> >x = (you will get the intellisense dropdown here) >> >> > >> >> > >> >> ><New***@gmail.com> wrote in message >> >> >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... >> >> >>I have been trying to lear vb.net and I cannot remeber how to do >> >> >> something that I read about a week ago and it is trying me crazy >> >> >> >> >> >> You now how if you creat a vriable that is boolean whe you type in >> >> >> X >> >> >> = the tru or false choice comes up. I want to creat a variable >> >> >> that >> >> >> is a string but can only exsit in three states top middle and >> >> >> bottom. >> >> >> I forgot how to do it. Sorry for this stupid question >> >> > >> > > Hoping that you have stopped beating your wife and children long enough to
read this conversation, I'll state that your code does not, in any way, address the question of having enums stored as strings. Your code is the same thing that I wrote, but you just added a property to get and set these enum values somewhere, but your propety is not of the string type (nor, could it be since the property must be of the same type as the enum). I guessing here, but maybe you mean you want to return the string value
of an enum item? Something like: Public Enum CurrentState top middle bottom End Enum Dim x As CurrentState = CurrentState.top Console.WriteLine(x.ToString()) ' Prints top Thanks, Seth Rowe New***@gmail.com wrote: Show quoteHide quote > Thanks that helps a lot. Is there any way to do it as a string > instead of an integer? > On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> > wrote: > > >Public Enum CurrentState > > top > > middle > > bottom > >End Enum > > > >Public x As CurrentState > >x = (you will get the intellisense dropdown here) > > > > > ><New***@gmail.com> wrote in message > >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... > >>I have been trying to lear vb.net and I cannot remeber how to do > >> something that I read about a week ago and it is trying me crazy > >> > >> You now how if you creat a vriable that is boolean whe you type in X > >> = the tru or false choice comes up. I want to creat a variable that > >> is a string but can only exsit in three states top middle and bottom. > >> I forgot how to do it. Sorry for this stupid question > > I thought you were meant to be the experts. Here it is again.....
Public Class MyClass Public Enum MyEnum Top Middle Bottom End Enum Private _Vertical_Position As MyEnum <Category("Appearance"), DefaultValue(GetType(MyEnum), "Middle")> _ Property [Vertical_Position]() As MyEnum Get Return _Vertical_Position End Get Set(ByVal Value As MyEnum) _Vertical_Position = Value End Set End Property ' ******************** ' To grab it after at runtime.... ' If Vertical_Position = MyEnum.Top then ' ' End If End Class New***@gmail.com wrote: Show quoteHide quote > Thanks that helps a lot. Is there any way to do it as a string > instead of an integer? > On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> > wrote: > > >Public Enum CurrentState > > top > > middle > > bottom > >End Enum > > > >Public x As CurrentState > >x = (you will get the intellisense dropdown here) > > > > > ><New***@gmail.com> wrote in message > >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... > >>I have been trying to lear vb.net and I cannot remeber how to do > >> something that I read about a week ago and it is trying me crazy > >> > >> You now how if you creat a vriable that is boolean whe you type in X > >> = the tru or false choice comes up. I want to creat a variable that > >> is a string but can only exsit in three states top middle and bottom. > >> I forgot how to do it. Sorry for this stupid question > > Wow, thanks Master Programmer. Thats just what I have been looking for.
You really are a master. Thanks Again Peter Master Programmer wrote: Show quoteHide quote > I thought you were meant to be the experts. Here it is again..... > > > Public Class MyClass > > Public Enum MyEnum > Top > Middle > Bottom > End Enum > > Private _Vertical_Position As MyEnum > > <Category("Appearance"), DefaultValue(GetType(MyEnum), "Middle")> _ > > Property [Vertical_Position]() As MyEnum > Get > Return _Vertical_Position > End Get > Set(ByVal Value As MyEnum) > _Vertical_Position = Value > End Set > End Property > > > ' ******************** > ' To grab it after at runtime.... > > > ' If Vertical_Position = MyEnum.Top then > ' > ' End If > > > End Class > > > > New***@gmail.com wrote: > > Thanks that helps a lot. Is there any way to do it as a string > > instead of an integer? > > On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> > > wrote: > > > > >Public Enum CurrentState > > > top > > > middle > > > bottom > > >End Enum > > > > > >Public x As CurrentState > > >x = (you will get the intellisense dropdown here) > > > > > > > > ><New***@gmail.com> wrote in message > > >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... > > >>I have been trying to lear vb.net and I cannot remeber how to do > > >> something that I read about a week ago and it is trying me crazy > > >> > > >> You now how if you creat a vriable that is boolean whe you type in X > > >> = the tru or false choice comes up. I want to creat a variable that > > >> is a string but can only exsit in three states top middle and bottom. > > >> I forgot how to do it. Sorry for this stupid question > > > Thanks, but I already know that I am the best and dont need to be told.
The Grand Master code_mun***@yahoo.com wrote: Show quoteHide quote > Wow, thanks Master Programmer. Thats just what I have been looking for. > You really are a master. > > Thanks Again > Peter > > > Master Programmer wrote: > > I thought you were meant to be the experts. Here it is again..... > > > > > > Public Class MyClass > > > > Public Enum MyEnum > > Top > > Middle > > Bottom > > End Enum > > > > Private _Vertical_Position As MyEnum > > > > <Category("Appearance"), DefaultValue(GetType(MyEnum), "Middle")> _ > > > > Property [Vertical_Position]() As MyEnum > > Get > > Return _Vertical_Position > > End Get > > Set(ByVal Value As MyEnum) > > _Vertical_Position = Value > > End Set > > End Property > > > > > > ' ******************** > > ' To grab it after at runtime.... > > > > > > ' If Vertical_Position = MyEnum.Top then > > ' > > ' End If > > > > > > End Class > > > > > > > > New***@gmail.com wrote: > > > Thanks that helps a lot. Is there any way to do it as a string > > > instead of an integer? > > > On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> > > > wrote: > > > > > > >Public Enum CurrentState > > > > top > > > > middle > > > > bottom > > > >End Enum > > > > > > > >Public x As CurrentState > > > >x = (you will get the intellisense dropdown here) > > > > > > > > > > > ><New***@gmail.com> wrote in message > > > >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... > > > >>I have been trying to lear vb.net and I cannot remeber how to do > > > >> something that I read about a week ago and it is trying me crazy > > > >> > > > >> You now how if you creat a vriable that is boolean whe you type in X > > > >> = the tru or false choice comes up. I want to creat a variable that > > > >> is a string but can only exsit in three states top middle and bottom. > > > >> I forgot how to do it. Sorry for this stupid question > > > > LOL - Do you know how sick you are to post messages under two different
names and then to carry on a conversation by yourself, patting yourself on the back?! Show quoteHide quote "Master Programmer" <master_program***@outgun.com> wrote in message news:1166848138.603903.309470@h40g2000cwb.googlegroups.com... > Thanks, but I already know that I am the best and dont need to be told. > > The Grand Master > > code_mun***@yahoo.com wrote: >> Wow, thanks Master Programmer. Thats just what I have been looking for. >> You really are a master. >> >> Thanks Again >> Peter >> >> >> Master Programmer wrote: >> > I thought you were meant to be the experts. Here it is again..... >> > >> > >> > Public Class MyClass >> > >> > Public Enum MyEnum >> > Top >> > Middle >> > Bottom >> > End Enum >> > >> > Private _Vertical_Position As MyEnum >> > >> > <Category("Appearance"), DefaultValue(GetType(MyEnum), "Middle")> _ >> > >> > Property [Vertical_Position]() As MyEnum >> > Get >> > Return _Vertical_Position >> > End Get >> > Set(ByVal Value As MyEnum) >> > _Vertical_Position = Value >> > End Set >> > End Property >> > >> > >> > ' ******************** >> > ' To grab it after at runtime.... >> > >> > >> > ' If Vertical_Position = MyEnum.Top then >> > ' >> > ' End If >> > >> > >> > End Class >> > >> > >> > >> > New***@gmail.com wrote: >> > > Thanks that helps a lot. Is there any way to do it as a string >> > > instead of an integer? >> > > On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> >> > > wrote: >> > > >> > > >Public Enum CurrentState >> > > > top >> > > > middle >> > > > bottom >> > > >End Enum >> > > > >> > > >Public x As CurrentState >> > > >x = (you will get the intellisense dropdown here) >> > > > >> > > > >> > > ><New***@gmail.com> wrote in message >> > > >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... >> > > >>I have been trying to lear vb.net and I cannot remeber how to do >> > > >> something that I read about a week ago and it is trying me crazy >> > > >> >> > > >> You now how if you creat a vriable that is boolean whe you type >> > > >> in X >> > > >> = the tru or false choice comes up. I want to creat a variable >> > > >> that >> > > >> is a string but can only exsit in three states top middle and >> > > >> bottom. >> > > >> I forgot how to do it. Sorry for this stupid question >> > > > > I am just so pleased I could be of help.
The Grand Master Scott M. wrote: Show quoteHide quote > LOL - Do you know how sick you are to post messages under two different > names and then to carry on a conversation by yourself, patting yourself on > the back?! > > > "Master Programmer" <master_program***@outgun.com> wrote in message > news:1166848138.603903.309470@h40g2000cwb.googlegroups.com... > > Thanks, but I already know that I am the best and dont need to be told. > > > > The Grand Master > > > > code_mun***@yahoo.com wrote: > >> Wow, thanks Master Programmer. Thats just what I have been looking for. > >> You really are a master. > >> > >> Thanks Again > >> Peter > >> > >> > >> Master Programmer wrote: > >> > I thought you were meant to be the experts. Here it is again..... > >> > > >> > > >> > Public Class MyClass > >> > > >> > Public Enum MyEnum > >> > Top > >> > Middle > >> > Bottom > >> > End Enum > >> > > >> > Private _Vertical_Position As MyEnum > >> > > >> > <Category("Appearance"), DefaultValue(GetType(MyEnum), "Middle")> _ > >> > > >> > Property [Vertical_Position]() As MyEnum > >> > Get > >> > Return _Vertical_Position > >> > End Get > >> > Set(ByVal Value As MyEnum) > >> > _Vertical_Position = Value > >> > End Set > >> > End Property > >> > > >> > > >> > ' ******************** > >> > ' To grab it after at runtime.... > >> > > >> > > >> > ' If Vertical_Position = MyEnum.Top then > >> > ' > >> > ' End If > >> > > >> > > >> > End Class > >> > > >> > > >> > > >> > New***@gmail.com wrote: > >> > > Thanks that helps a lot. Is there any way to do it as a string > >> > > instead of an integer? > >> > > On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." <s-mar@nospam.nospam> > >> > > wrote: > >> > > > >> > > >Public Enum CurrentState > >> > > > top > >> > > > middle > >> > > > bottom > >> > > >End Enum > >> > > > > >> > > >Public x As CurrentState > >> > > >x = (you will get the intellisense dropdown here) > >> > > > > >> > > > > >> > > ><New***@gmail.com> wrote in message > >> > > >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... > >> > > >>I have been trying to lear vb.net and I cannot remeber how to do > >> > > >> something that I read about a week ago and it is trying me crazy > >> > > >> > >> > > >> You now how if you creat a vriable that is boolean whe you type > >> > > >> in X > >> > > >> = the tru or false choice comes up. I want to creat a variable > >> > > >> that > >> > > >> is a string but can only exsit in three states top middle and > >> > > >> bottom. > >> > > >> I forgot how to do it. Sorry for this stupid question > >> > > > > > Ok Sybil.
Show quoteHide quote "Master Programmer" <master_program***@outgun.com> wrote in message news:1166923828.914750.48840@79g2000cws.googlegroups.com... >I am just so pleased I could be of help. > > The Grand Master > > Scott M. wrote: >> LOL - Do you know how sick you are to post messages under two different >> names and then to carry on a conversation by yourself, patting yourself >> on >> the back?! >> >> >> "Master Programmer" <master_program***@outgun.com> wrote in message >> news:1166848138.603903.309470@h40g2000cwb.googlegroups.com... >> > Thanks, but I already know that I am the best and dont need to be told. >> > >> > The Grand Master >> > >> > code_mun***@yahoo.com wrote: >> >> Wow, thanks Master Programmer. Thats just what I have been looking >> >> for. >> >> You really are a master. >> >> >> >> Thanks Again >> >> Peter >> >> >> >> >> >> Master Programmer wrote: >> >> > I thought you were meant to be the experts. Here it is again..... >> >> > >> >> > >> >> > Public Class MyClass >> >> > >> >> > Public Enum MyEnum >> >> > Top >> >> > Middle >> >> > Bottom >> >> > End Enum >> >> > >> >> > Private _Vertical_Position As MyEnum >> >> > >> >> > <Category("Appearance"), DefaultValue(GetType(MyEnum), >> >> > "Middle")> _ >> >> > >> >> > Property [Vertical_Position]() As MyEnum >> >> > Get >> >> > Return _Vertical_Position >> >> > End Get >> >> > Set(ByVal Value As MyEnum) >> >> > _Vertical_Position = Value >> >> > End Set >> >> > End Property >> >> > >> >> > >> >> > ' ******************** >> >> > ' To grab it after at runtime.... >> >> > >> >> > >> >> > ' If Vertical_Position = MyEnum.Top then >> >> > ' >> >> > ' End If >> >> > >> >> > >> >> > End Class >> >> > >> >> > >> >> > >> >> > New***@gmail.com wrote: >> >> > > Thanks that helps a lot. Is there any way to do it as a string >> >> > > instead of an integer? >> >> > > On Wed, 20 Dec 2006 21:12:23 -0500, "Scott M." >> >> > > <s-mar@nospam.nospam> >> >> > > wrote: >> >> > > >> >> > > >Public Enum CurrentState >> >> > > > top >> >> > > > middle >> >> > > > bottom >> >> > > >End Enum >> >> > > > >> >> > > >Public x As CurrentState >> >> > > >x = (you will get the intellisense dropdown here) >> >> > > > >> >> > > > >> >> > > ><New***@gmail.com> wrote in message >> >> > > >news:77qjo21a7vqprikq4uho146l4qji9is8fc@4ax.com... >> >> > > >>I have been trying to lear vb.net and I cannot remeber how to do >> >> > > >> something that I read about a week ago and it is trying me >> >> > > >> crazy >> >> > > >> >> >> > > >> You now how if you creat a vriable that is boolean whe you >> >> > > >> type >> >> > > >> in X >> >> > > >> = the tru or false choice comes up. I want to creat a variable >> >> > > >> that >> >> > > >> is a string but can only exsit in three states top middle and >> >> > > >> bottom. >> >> > > >> I forgot how to do it. Sorry for this stupid question >> >> > > > >> > > <New***@gmail.com> schrieb:
> You now how if you creat a vriable that is boolean whe you type in X Creating enumerations of items with a certain arbitrary data type> = the tru or false choice comes up. I want to creat a variable that > is a string but can only exsit in three states top middle and bottom. <URL:http://dotnet.mvps.org/dotnet/faqs/?id=anytypeenums&lang=en> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> |
|||||||||||||||||||||||