433
ห้อง MS Access / : การทำข้อความบน txtbox พอกดแล้วให้หายไป
« เมื่อ: 11 ก.พ. 63 , 10:03:29 »อยากทำฟอร์ม access
ข้อความใน textbox ก่อนกรอกข้อมูล แล้วพอกดที่ text ให้ข้อความหาย เห็นกับ ช่องค้นหาของเว็บนี้ครับ
ไม่รู้ว่าเรียกแบบนี้ว่าอะไรครับ
สมมุติ มี textbox ชื่อ text0 นะครับ เราจะใช้ 3 event
Private Sub Form_Current()
Me.Text0.ForeColor = RGB(200, 200, 200)
Me.Text0.Value = "My Program Custom Search"
End Sub
Private Sub Text0_Exit(Cancel As Integer)
If IsNull(Me.Text0) Then
Me.Text0.ForeColor = RGB(200, 200, 200)
Me.Text0.Value = "My Program Custom Search"
End If
End Sub
Private Sub Text0_GotFocus()
If Me.Text0.Value = "My Program Custom Search" Then
Me.Text0.Value = Null
Me.Text0.ForeColor = RGB(0, 0, 0)
End If
End Sub
ลองดูครับ