Vadim,
Have you tried:
Public Function OurFunction(ByVal s As String) As Size
' magic to convert s to a Size.
End Function
Note: I would normally create "OurFunction" as a Shared function called
Parse:
Public Structure MyStruct
Private ReadOnly m_value As Integer
Public Sub New(ByVal value As Integer)
m_value = value
End Sub
Public Overrides Function ToString() As String
Return m_value.ToString()
End Function
Public Shared Function Parse(ByVal s As String) As MyStruct
Return New MyStruct(Integer.Parse(s))
End Function
End Structure
Note: I would consider using String.Split to parse the input string to the
Parse function.
Hope this helps
Jay
"Vadim Rapp" <vr@myrealbox.nospam.com> wrote in message
news:eK**************@TK2MSFTNGP11.phx.gbl...
Hello:
Is there a way to assign a structure from the result of
<structure>.ToString in one statement?
For instance, if such function existed, it might look like this:
Me.Size = OurFunction(Me.Size.Tostring)
thanks,
Vadim