Hmm.. no.
More exactly, I need to convert any string informed because I cant wonder
wich type the developer user will put in my xml config file (in my case, I
get from this file to use the reflection). This way, I need to convert the
complete string (for samples, System.String,
System.Windows.Forms.DockingStyle, System.Drawing.Color, etc)
Cesar
"Rob Windsor [MVP]" <ro*****************@gmail.com> wrote in message
news:uc**************@tk2msftngp13.phx.gbl...
I think this is what you want:
Imports System.Windows.Forms
....
Dim obj As Object
Dim ds As DockStyle
obj = [Enum].Parse(GetType(DockStyle), "Bottom")
ds = CType(obj, DockStyle)
--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada
http://msmvps.com/windsor/
"Ronchese" <ro******@smlinfo.com.br> wrote in message
news:u1**************@tk2msftngp13.phx.gbl...
Hi all.
Is possible I coerce a value to a determined type informed by a string?
See
the sample:
dim obj as Object
obj = SomeConversionType(2, "System.Windows.Forms.DockStyle")
or
obj = SomeConversionType("System.Windows.Forms.DockStyle .Bottom")
?
I need use that because I'm loading and setting an object via reflection,
and for reflection can find the corret Property, I must to inform the
exact
value type.
Its possible do that? Or have other way?
[]s
Cesar