Dear Sir:
I had two form, form1 & form2. At form1 I had 4 TextBox for input some value & one Button for click it to shows form2, at form2 I had one PictureBox for show my draw & one button for draw a cuver line and my code as following;
public Form1()
{
InitializeComponent();
}
public void TextBox_Set()
{
double x1 = Convert.ToDouble(textBox1.Text);
double y1 = Convert.ToDouble(textBox2.Text);
double x2 = Convert.ToDouble(textBox3.Text);
double y2 = Convert.ToDouble(textBox4.Text);
}
private void button1_Click_1(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.Show();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
public void Draw_gp(object sender, PaintEventArgs e)
{
Graphics g = pictureBox1.CreateGraphics();
int x1, y1, x2, y2;
Pen p = new Pen(Color.Green, 2);
Pen p1 = new Pen(Color.Red, 2);
Point[] cp =
{
new Point ( x1, y1), new Point ( x2, y2)
};
g.DrawCurve(p, cp);
}
private void button1_Click(object sender, EventArgs e)
{
Paint += new PaintEventHandler(Draw_gp);
}
My question is how can I use the values which I input into the 4 Textboxs of form1?
Could anyone please help me? Thanks a lot.











