Structures instead of types....

Hello, i use to use types in vb6, but now i use structures, thoght i didn't use types very well, i knew what they did and i knew what to do when i needed them.  Now i need them, but im playing around in vb.net trying to get myself ready to convert some major things to it.  Can you see what im trying to do here, and help me fix it?

Module Module1
    Public Structure Colors
        Public Red As String = "12121G1"
        Public Blue As String = "465C434"
        Public Green As String = "871X032"
        Public Yellow As String = "5B46873"
        Public Black As String = "A465468"
    End Structure
    Public Function NewFunction(ByVal Stuff As String, ByVal Colorx As Colors) As String
        MsgBox(Colorx)
        Colorx.Red = Stuff
    End Function
End Module

Im trying to set it up so when i type under a form1.button1 the function like this: NewFunction("MyStringHere",colors.red)  I want the user to see the list of colors after typing in the "colors." and then i want it to have that value when it executes the function.
clear100-comAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
VB.NET has a Color structure, and supporting color classes, so how are you trying to do something different.  What do the color values represent?

Bob
0
clear100-comAuthor Commented:
Actually, i was just using the names of colors just to use somthing, basicly let me explain this, you know when your typing msgbox("stuff"... and you hit the comma button on your keyboard and because this function "msgbox" has a list of items that you can choose like vbcancle etc... i want my function to have that list.
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
What you are describing is an Enum, but they can only hold numbers, not strings:

Module Module1

    Public Enum myValues
        Red = -3
        Blue = -1
        Green = 0
        Yellow = 1
        Black = 3
    End Enum

    Public Function myFunction(ByVal Stuff As String, ByVal myValue As myValues) As String
        Select Case myValue
            Case myValues.Red
                Return "Red " & Stuff

            Case myValues.Blue
                Return "Blue " & Stuff

            Case myValues.Green
                Return "Green " & Stuff

            Case myValues.Yellow
                Return "Yellow " & Stuff

            Case myValues.Black
                Return "Black " & Stuff

        End Select
    End Function

End Module
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
clear100-comAuthor Commented:
Perfect!! That is what i wanted..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

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.