Home All Groups Group Topic Archive Search About

Help populating control.location with string value

Author
25 Nov 2006 9:49 AM
Marc
I have the below code which works fine. However I need a way for the
test.location line to read the string in form my text file? the line
firm myfilecontents looks like this {X=425,Y=310}.
how can I do this? i.e test.location = myfilecontents

MyFileContents = TextFileStream.ReadLine
            Dim test As New Button()
            test.Text = MyFileContents
            MyFileContents = TextFileStream.ReadLine
            test.Location = New Point(1, 2)
            Me.Controls.Add(test)

Author
25 Nov 2006 11:14 AM
tommaso.gastaldi@uniroma1.it
Aren't you making your life more complicate than necessary?

Why do you not just serialize using an XML or binary formatter, so that
the deserialize routine will handle that for you?

Marc ha scritto:

Show quoteHide quote
> I have the below code which works fine. However I need a way for the
> test.location line to read the string in form my text file? the line
> firm myfilecontents looks like this {X=425,Y=310}.
> how can I do this? i.e test.location = myfilecontents
>
>  MyFileContents = TextFileStream.ReadLine
>             Dim test As New Button()
>             test.Text = MyFileContents
>             MyFileContents = TextFileStream.ReadLine
>             test.Location = New Point(1, 2)
>             Me.Controls.Add(test)