I have problem, I was using the Visal Basic, and now have to migrate to the C#. Its not a problem. But in first steps with C# I have found a few diferences from VB. One I cant solve. For example in Form1 I have a TextBox1 and a Button1. I enter in TextBox1 "sviec", and click the Button1. Then opens the Form2 with Label1 on it and label says "sviec". In VB the Form2 code looks like this:
Public
Class Form2 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Label1.Text = Form1.TextBox1.Text End SubEnd
ClassSo how I can translate this Me.Label1.Text = Form1.TextBox1.Text from VB to C#
Thank You!

How to use the controls from another form in form I working in.
hollow
here's your answer:
this.Label1.Text = Form1.TextBox1.Text;
rameshkl
pjam
Visual C# Novice
Mateusz Rajca
Aint working - Error 1 An object reference is required for the nonstatic field, method, or property 'CSpalidziba.Form1.textBox1'
And in the list ther still is no textBox1
DavidR100
Form1 form = sender as Form1;
if(form != null)
this.Label1.Text = form.TextBox1.Text;
wum