Anyway, what i'm trying to do here is have the text a person enters in a textbox on Form2, to display in a label in Form6.
Heres my code for form 2:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ToL
{
public partial class Form2 : Form
{
public static string HeroName;
public Form2()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
public void textBox1_TextChanged(object sender, EventArgs e)
{
string Heroname = textBox1.Text;
}
public void button1_Click(object sender, EventArgs e)
{
Form3 form3 = new Form3();
this.Hide();
form3.Show();
}
}
}
Code for form 6:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ToL
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
public void label1_Click_1(object sender, EventArgs e)
{
Form2.HeroName = label1.Text;
}
public void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
Am I way off? I read several tutorials and im trying to work with this method. Any help would be greatly appreciated.
Thanks!

New Topic/Question
Reply




MultiQuote





|