We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,324 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to get Values from Dynamic generated Textbox

I'm new to Visual Basic.
I have a little program look like this.
https://www.dropbox.com/s/xr44pxp3n79atkk/wall.png <Please have a look

It will calculate the total area by adding up all wall area.

 Public Sub btnWallAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWallAdd.Click
        FlowLayoutPanel1.Controls.Clear()
        FlowLayoutPanel1.AutoScroll = True

        For i As Integer = 1 To Val(txtWallNo.Text)
            Dim Width As New TextBox()
            Dim Height As New TextBox()

            Width.Name = "Width" & i
            Width.Text = Width.Name
            Height.Name = "Height" & i
            Height.Text = Height.Name

            FlowLayoutPanel1.Controls.Add(Width)
            FlowLayoutPanel1.Controls.Add(Height)

        Next
    End Sub

I have successfully create dynamic textbox base on the number entered by user but I don't know how to get values from those textbox an add them up. Please teach me how do it. Thank you very much!
Sorry for my English!

2
Contributors
1
Reply
39 Minutes
Discussion Span
10 Months Ago
Last Updated
2
Views
musicazx
Newbie Poster
1 post since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Been a long time since I touched VB.Net,

A quick google showed the following as a way to do it, however I have not confirmed this myself.

TabPage.Controls.Find("ControlName", true)

Where the true options also searches child controls.

MikeyIsMe
Practically a Posting Shark
802 posts since Nov 2010
Reputation Points: 88
Solved Threads: 69
Skill Endorsements: 10

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.1004 seconds using 2.67MB