Help populating control.location with string value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc

    #1

    Help populating control.location with string value

    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)

  • tommaso.gastaldi@uniroma1.it

    #2
    Re: Help populating control.locatio n with string value

    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:
    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)

    Comment

    Working...