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

multiple forms

i have two forms in my program. The second form appears when button1 is clicked. I would like the information (textboxes) to be filled in when the second form loads. basically i have a complex calculator and when button 1 is clicked i want a second form to show with multiple answers populated into textboxes. any ideas?

3
Contributors
3
Replies
10 Hours
Discussion Span
1 Year Ago
Last Updated
4
Views
Question
Answered
ng5
Light Poster
42 posts since Dec 2011
Reputation Points: 19
Solved Threads: 0
Skill Endorsements: 0
Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        With Form2
            .TextBox1.Text = TextBox1.Text
            .Show()
        End With
    End Sub
End Class
codeorder
Postaholic
2,124 posts since Aug 2010
Reputation Points: 256
Solved Threads: 387
Skill Endorsements: 8

You can also do:

Public Class Form1
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Form2.Show()
        Form2.TextBox1.Text = Me.TextBox1.Text 'Where Me references Form1 - the TextBox1 from Form1
    End Sub
End Class
Begginnerdev
Practically a Posting Shark
864 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8

thank you

ng5
Light Poster
42 posts since Dec 2011
Reputation Points: 19
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by codeorder and Begginnerdev

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0661 seconds using 2.67MB