• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

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