Article View: fj.lang.visualbasic
Article #1191_LostFocus + .SetFocus
From: KOKUBUN shige.
Date: Wed, 15 Oct 1997 00:00
Date: Wed, 15 Oct 1997 00:00
48 lines
1668 bytes
1668 bytes
VB4.0 $B$r;HMQ$7$F$$$^$9!#(J
Text_LostFocus()$B%$%Y%s%H$K$h$kF~NO%G!<%?$N%A%'%C%/=hM}$G(J
$B%(%i!<$,$"$C$?$i(J .SetFocus $B$G:FF~NO$7$F$b$i$&;v$r9M$($^$7$?!#(J
$B$7$+$7!"(J
'------$B%k!<%W$9$k(J
Private Sub Text1_LostFocus()
If Not (Text1.Text = "1") Then
Call MsgBox("$BCM$,ITEv$G$9(J", vbOKOnly)
Text1.SetFocus
End If
End Sub
$B$N$h$&$J=hM}$@$H!"MxMQ<T$,@5$7$$CM$rF~NO$7$J$$8B$j(J
$B%-%c%s%;%k$G$-$J$/$J$j$^$9!#(J
$B;EJ}$,L5$$$N$G!"2s?t$K$h$k@)8B$r@_$1$^$7$?!#(J($B"(DI2CItJ,(J)
'------$B2s?t@)8B(J
Dim nErrorCount As Integer '$B"((J
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Text1_Change()
nErrorCount = 0 '$B"((J
End Sub
Private Sub Text1_LostFocus()
If nErrorCount > 2 Then Exit Sub '$B"((J
nErrorCount = nErrorCount + 1 '$B"((J
If Not (Text1.Text = "1") Then
Call MsgBox("$BCM$,ITEv$G$9(J", vbOKOnly)
Text1.SetFocus
End If
End Sub
$B%-%c%s%;%k%\%?%s$N(J _Click $B%$%Y%s%H$@$1$O!"(J
Text_LostFocus $B$h$jM%@h$5$;$?$$$N$G$9$,!"(J
$B$3$N$h$&$J$3$H$O2DG=$J$N$G$7$g$&$+!#(J
$B$b$C$HNI$$J}K!$,$"$l$P!"%R%s%H$@$1$G$b65$($F$/$@$5$$!#(J
# $B$b$A$m$s<B:]$NH=CG=hM}$O$b$&>/$7J#;($G$9!#(J(^^;
--
$B9qJ,(J mailto:kokubun@ffc.co.jp
Technical Details
Message-ID:
<3444A353.7A36@ffc.co.jp>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS X-Google-Thread: 105c2e,7b595841ef62fd65,start X-Google-Attributes: gid105c2e,public From: "KOKUBUN shige." <kokubun@ffc.co.jp> Subject: _LostFocus + .SetFocus Date: 1997/10/15 Message-ID: <3444A353.7A36@ffc.co.jp> X-Deja-AN: 280774473 Organization: Fuji Facom System Inc. Newsgroups: fj.lang.visualbasic