 |
|
|
 |
 |
|
ไม่รู้ใช่อย่างที่ต้องการรึป่าวน่ะ
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If KeyAscii = 13 Then
TextBox2.Focus()
End If
End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If KeyAscii = 13 Then
TextBox3.Focus()
End If
End Sub
Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If KeyAscii = 13 Then
Button1.Focus()
End If
End Sub
|
 |
 |
 |
 |
Date :
2009-09-06 08:33:42 |
By :
liamlived |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากๆๆ เลยครับ รอตั้งนาน
ใช้ได้ครับ แต่ อยากให้พอกดจากtextแล้ว button มันทำงานเลย
ทำแบบนี้ต้องกด enter ถึง 2 ครั้ง จึงจะทำงานอ่ะครับ
อีกข้อครับรบกวนด้วย
แบบผมทำหน้าจอlogin เวลาใส่พาสเวิลตรงtextbox อยากจะให้มันขึ้น ****** แทนตัวที่พิมพ์ไปทำไงอ่ะครับ
|
 |
 |
 |
 |
Date :
2009-09-06 10:24:19 |
By :
phoenix69 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
------> อีกข้อครับรบกวนด้วย
แบบผมทำหน้าจอlogin เวลาใส่พาสเวิลตรงtextbox อยากจะให้มันขึ้น ****** แทนตัวที่พิมพ์ไปทำไงอ่ะครับ
เลือก textbox ที่ต้องการ เลือก properties -------> passwordchar ใส่ * ไป1ตัวครับ
|
 |
 |
 |
 |
Date :
2009-09-06 21:05:42 |
By :
liamlived |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ประมาณนี้อ่ะป่าวครับ
Code (VB.NET)
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If KeyAscii = 13 Then
TextBox2.Focus()
btn()
End If
End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If KeyAscii = 13 Then
Button1.Focus()
btn()
End If
End Sub
Sub btn()
If TextBox1.Text <> "" And TextBox2.Text <> "" Then
MsgBox("ทำงาน")
End If
End Sub
|
 |
 |
 |
 |
Date :
2009-09-06 21:14:18 |
By :
liamlived |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ
Code (VB.NET)
Private Sub username_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles username.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If KeyAscii = 13 Then
If username.Text = "" Then
MessageBox.Show("กรุณาใส่ User Name ด้วยครับ", "No UserID", MessageBoxButtons.OK, MessageBoxIcon.Error)
username.Focus()
Else
password_txt.Focus()
End If
End If
End Sub
Private Sub password_txt_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles password_txt.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If KeyAscii = 13 Then
If username.Text = "" Then
MessageBox.Show("กรุณาใส่ PassWord ด้วยครับ", "No Password", MessageBoxButtons.OK, MessageBoxIcon.Error)
username.Focus()
Else
bt_ok.PerformClick()
End If
End If
End Sub
|
 |
 |
 |
 |
Date :
2009-09-07 07:19:28 |
By :
phoenix69 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|