[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

how do you associate a variable with an enumeration so that when you type myVariable=the enumerations pop up with intellisense

I am using vb.net and am a real novice
I have the following code
Public Enum mMode
        editWord
        editLine
        playWord
        playLine
    End Enum
then I have a variable called myMode
and I type myMode=mMode.editWord
How do you code it so that as soon as I type myMode= all the possible mMode enumerations pop up?
0
Dov_B
Asked:
Dov_B
  • 3
1 Solution
 
mirzasCommented:
when you type the enimeration name and hit the "dot" you will get a list of items inside the enum.
0
 
brenz08Commented:
Try using the following code below, if you do not yet have a similar code to the one you are wanting help on.

Then, when wanting to use MyMode, type the following: " MyMode. " and a list should come up showing your vairables under mMode (editWord, editLine, playWord, playLine).

Try that and see how you go.
Public Enum mMode
    editWord
    editLine
    playWord
    playLine
End Enum
 
Dim MyMode As mMode
 
'you can also use the following when coding (if this works in .NET) ??
With MyMode
    .editWord = "123"    'makes "editWord" have the value 123
    .editLine = "456"    'when coding, and placing a dot, a list
End With                 'should automatically appear.

Open in new window

0
 
brenz08Commented:
Actually, ignore my comment, and code!!
Got confused with the wrong thing..Argh!

When you type "MyMode=" it should automatically come up with a list of enumerations...It does with me?

Thanks.
0
 
brenz08Commented:
Thanks Dov_B,
Hope all goes well.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now