Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

C# Questions I Have For Forms

$
0
0

Question 1 ---

I am trying to make it so that when a user inputs there name, it will open a new form and display there name on that form. I Guess All I Need Is A Variable...

Code For Users Input:

//This Button Will Do ALL The Logging In Info
            string name = textBox2.Text;
            if (textBox2.Text == ("test,test")) //Login #1 = Developers Login
            {
                textBox4.Text = ("Hello " +name); // This Part Displays There Username On Form1
                textBox1.ReadOnly = false;

                Form2 menu = new Form2();

               menu.Show();  // Then Form 2 Opens

            }

All I Need Is A Way To Send The Variable String 'name' onto the other form


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>