Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
VB.NET Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
C#
Windows Forms
Creating Form1 txt file, to use in Form2 (HangMan)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Crystas, post: 25641, member: 16002"] I'm stuck... Form1: I created an easy Form with Name, LastName and Age. I save the FirstName and LastName in a log.txt file and i want to use it in Form2, but i can't get it to work. Here is the part of the code that i save the First/Last name. [CODE lang="csharp" title="Form1"]private void btn_next_Click(object sender, EventArgs e) { // use Path.Combine to combine 2 strings to a path File.WriteAllText(Path.Combine("log.txt"), txt_firstname.Text + " " + textBox2.Text); if (txt_firstname.Text == "" || textBox2.Text == "" || textBox1.Text == "") { MessageBox.Show("Please fill all the form fields!"); return; } else { Galgje myForm = new Galgje(); this.Hide(); myForm.Show(this); } }[/CODE] Form2: Here is the part where i keep changing things, But if it wants to load the log.txt file it can't find it because it isn't created yet, but i want to use the name that the user use in log.txt And that man is hanging alot in my tests and will get the message to the directory.log.txt but it doesn't show the words. ATM i only have: [CODE lang="csharp" title="Form2" highlight="target = Path.Combine(Directory.GetCurrentDirectory());"]private void button1_Click(object sender, EventArgs e) { //Ended here need to fix it target = Path.Combine(Directory.GetCurrentDirectory()); }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
C#
Windows Forms
Creating Form1 txt file, to use in Form2 (HangMan)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom