Controls [vb.net] TextBox 기본 문구/안내 문구(Default Text) 설정
페이지 정보
본문
Private Sub BhsTextBox_x_LostFocus(sender As Object, e As EventArgs) Handles BhsTextBox1.LostFocus, BhsTextBox2.LostFocus
Dim btb As CustomControls.bhsTextBox = DirectCast(sender, CustomControls.bhsTextBox)
If btb.Texts.Length = 0 Then btb.Texts = btb.Tag
If btb.Texts = btb.Tag Then
btb.ForeColor = Color.LightGray
Else
btb.ForeColor = Color.DimGray
End If
End Sub
Private Sub BhsTextBox_x_GotFocus(sender As Object, e As EventArgs) Handles BhsTextBox1.GotFocus, BhsTextBox2.GotFocus
Dim btb As CustomControls.bhsTextBox = DirectCast(sender, CustomControls.bhsTextBox)
If btb.Texts = btb.Tag Then
btb.Texts = ""
btb.ForeColor = Color.LightGray
Else
btb.ForeColor = Color.DimGray
End If
End Sub
Private Sub BhsTextBox_x_TextChanged(sender As Object, e As EventArgs) Handles BhsTextBox1.TextChanged, BhsTextBox2.TextChanged
Dim btb As CustomControls.bhsTextBox = DirectCast(sender, CustomControls.bhsTextBox)
If btb.Texts = btb.Tag Then btb.Texts = ""
If btb.Texts = btb.Tag Then
btb.ForeColor = Color.LightGray
Else
btb.ForeColor = Color.DimGray
End If
End Sub
.BhsTextBox1.Tag = "휴대폰 번호를 입력하세요."
.BhsTextBox1.Texts = .BhsTextBox1.Tag
.BhsTextBox2.Tag = "이름을 입력하세요."
.BhsTextBox2.Texts = .BhsTextBox2.Tag
- 이전글[vb.net, C#] Selenium Webdriver에서 iFrame을 처리하는 방법: switchTo() 22.09.24
- 다음글[vb.net] MakeTransparent 이미지 지정한 컬러 투명하게 만들기 22.09.19
댓글목록
등록된 댓글이 없습니다.