Click here to Skip to main content
12,691,231 members (30,317 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
I have two forms.
In the first form there is TextBox1
I want get this property from second Form, that calls about click first form.
Thank you
Code on VB.NET
Posted 7-Feb-13 21:54pm
Junoli391

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

It's difficult to work out exactly what you are trying to do here - your question is not very clear.
So I can't really give you code!

Lets say you have two forms: Form1 and Form2. Form1 has a textbox.

If a button on Form1 opens Form2 and you want to set a value on From2 to the content of the textbox:
1) Either create a Form2 constructor that take a string parameter, and construct it with the string directly,
or
2) Create a string property in Form2 which can accept the value,
2.1) Set the Form2 instance property after your create it and before you call ShowDialog.

If you want a button on Form2 to fetch a value from Form1 then that is a little more complex - ask and I'll tell you.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170117.1 | Last Updated 8 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100