How to Pass Enum values in and out of a usercontrol?

joshuaand

Well-known member
Joined
Sep 2, 2003
Messages
45
Location
Australia
Hi,

I have been creating a usercontrol for a while now and had a form inside the project that I was testing it with, passing Enum values in and out of Properties and Functions and it worked great, but when I compiled my control into a dll and attached it to my real project, the enums no longer seem to be passed correctly.

Here are the problems I am having:

My control is called: ComPortControl

Stuff Declared in the CONTROL


Private theTranslationMode As Translation


Public Enum Translation
None
Sony_422
TC_Server_Box
End Enum

Public Property TranslationMode() As Translation
Get
Return theTranslationMode
End Get
Set(ByVal Value As Translation)
theTranslationMode = Value
End Set
End Property

End control Declarations


Ok so when the control is created it sets a default value for the properties, as such (only 1 listed):

Me.ComPortControl.TranslationMode = comPortControl.Translation.None

So it sets the default value to the first value of the enum.

This however produces an error:
Translation is not a member of comPortControl.comPortControl.

How do I stop this from happening??

Any help is appreciated.

Thankyou
Joshua
 
Hi,

my problem was that I was renaming "ComPortControl1" to "ComPortControl", which was the problem, when I renamed it to "myComPortControl" it was all good.

Thanks for your help.

Thanks
Josh
 
Back
Top