Results 1 to 4 of 4

Thread: Can anyone find the Error?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Location
    Florida/Maryland
    Posts
    21

    Question Can anyone find the Error?

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

    Dim txtTextBox As System.Windows.Forms.TextBox
    Dim iLoop As Integer

    For iLoop = 0 To 9
    txtTextBox = New TextBox()
    txtTextBox.Name = "txtTextBox"&iLoop
    txtTextBox.Text = CStr(iReadPresetsIn(iLoop))
    Next iLoop
    End Sub

    The above was written in an attempt to “automatically” read “iReadPresetsIn” into textboxes on a form (“iReadPresetsIn” are variables that are read in from another application via an ActiveX).

    The textboxes (on the application’s Form) are named txtTextBox0 through txtTextBox9.
    The code compiles, but I’m not able to load anything into the form’s textboxes.

    Terje

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    are the textboxes showing up, becuase I dont even see you code of where you are adding the textboxes to the forms collection???

    Me.Controls.Add(txtTextBox)

    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Location
    Florida/Maryland
    Posts
    21

    Question

    Thanks for your reply.
    The number of textboxes are fixed and they are put on the form via the "normal" form designer. The names of the textboxes on the Form are the same as in the code (i.E. txtTextBox(x).

    Terje

  4. #4
    Lively Member Nator's Avatar
    Join Date
    Nov 1999
    Location
    East Larryville, GA
    Posts
    80
    If you step through the subroutine are values/data showing up in the Cstr(iReadPresetsIn(iLoop))? Sounds like your ActiveX isn't passing the values.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width