CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Feb 2010
    Posts
    6

    Unhappy How to get the TEXT values Entered in Text boxes Dynamically.???

    Hello everybody..... i'm having the following code to add the textboxes dynamically.... now i want to get the values entered in that textboxes dynamically..... PLS HEPL ME OUT....


    heres the code:

    Code:
    Public Class Form1
        Public x = 17
        Public y = 60
        Public Num As Integer
        Public sNum As String
        Private Sub frmDynamic_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            sNum = InputBox("No of File to be uploaded...?", "FTP-Up Load", "", )
            Me.ForeColor = Color.Black
            Me.BackColor = Color.AliceBlue
            If Integer.TryParse(sNum, Num) Then
                addTxtToMe(Num)
                Button1_mousemove()
            Else
                MessageBox.Show("App Quits!!! You did not enter a valid number")
                End
            End If
    
        End Sub
        Public Sub addTxtToMe(ByVal Num As Integer)
            For counter As Integer = 1 To Num
                Dim txt As New TextBox()
                txt.Name = "txtDynamic" & counter
                txt.Location = New Point(x, y)
                txt.Size = New Size(190, 25)
                Me.Controls.Add(txt)
                y = y + 25
                If y > 555 Then
                    x = x + 210
                    y = 5
                End If
            Next
        End Sub
        Private Sub Button1_mousemove()
            Button1.Name = "butDynamic"
            Button1.Text = "Submit"
            Button1.Location = New Point(x, y)
            Button1.Parent = Me
        End Sub
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            'For counter As Integer = 1 To Num
            '    Dim i = 1
            '    If Not txt.Text Is Nothing Then
            '        Do
            '            End
            '        Loop
            '    End If
    
            'Next
        End Sub
    End Class



    Pls figure out the mistakes n corrections.....


    THANKS IN ADVANCE...........
    Last edited by HanneSThEGreaT; February 18th, 2010 at 02:56 AM.

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

Featured