|
|
|
เรียนผู้รู้ C# ช่วยแนะนำโค้ด การกดปุ่มเดิมแต่ค่าใส่ต่าง textbox กัน |
|
|
|
|
|
|
|
Code (C#)
bool focus_txtbx1, focus_txtbx2;
private void button1_Click(object sender, EventArgs e)
{
if (focus_txtbx1 == true)
{
this.textBox1.Text = "Focus Textbox1 insert data to textbox 1";
focus_txtbx1 = false;
}
if (focus_txtbx2 == true)
{
this.textBox2.Text = "Focus Textbox2 insert data to textbox 2";
focus_txtbx2 = false;
}
}
private void textBox2_MouseDown(object sender, MouseEventArgs e)
{
focus_txtbx2 = true;
}
private void textBox1_MouseDown(object sender, MouseEventArgs e)
{
focus_txtbx1 = true;
}
|
|
|
|
|
Date :
2014-06-02 11:17:03 |
By :
CPU4Core |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอามามิ๊ก กับอันเก่าที่พี่เขียนให้ ยังงอ่ะครับ
Code (C#)
int val, total;
private void button1_Click(object sender, EventArgs e)
{
this.button1.Text = "5";
val = Convert.ToInt32((this.button1.Text));
total = total + val;
this.textBox1.Text = Convert.ToString(total);
}
|
|
|
|
|
Date :
2014-06-02 11:33:01 |
By :
hatricktion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
http://stackoverflow.com/questions/4199029/net-which-control-has-focus-visual-studio-2008
|
|
|
|
|
Date :
2014-06-03 11:08:29 |
By :
deksoke |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|