🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: fj.lang.visualbasic
5 messages
5 total messages Started by KOKUBUN shige. Wed, 15 Oct 1997 00:00
_LostFocus + .SetFocus
#1191
Author: KOKUBUN shige.
Date: Wed, 15 Oct 1997 00:00
48 lines
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
Re: _LostFocus + .SetFocus
#1194
Author: Hasegawa Fumihiko
Date: Wed, 15 Oct 1997 00:00
17 lines
1022 bytes
>$B%-%c%s%;%k%\%?%s$N(B _Click $B%$%Y%s%H$@$1$O!"(B
>Text_LostFocus $B$h$jM%@h$5$;$?$$$N$G$9$,!"(B
>$B$3$N$h$&$J$3$H$O2DG=$J$N$G$7$g$&$+!#(B
>$B$b$C$HNI$$J}K!$,$"$l$P!"%R%s%H$@$1$G$b65$($F$/$@$5$$!#(B
>

$BJ82=%*%j%(%s%H<R$N(BQuickPackPro$B$K$D$$$F$k(BCsCommandButton$B$K$O!"(B
$B%/%j%C%/;~$K%U%)!<%+%9$N0\F0$r5/$3$5$J$$5!G=$,$"$j$^$9!#(B

#VB5.0$B$K$OBP1~$7$F$$$J$$$h$&$G$9$,!"(B5.0$B$N>l9g$O(BActiveX$B%3%s%H%m!<%k$r(B
#$B<+J,$G:n@.$9$l$PF1$85!G=$r<B8=$G$-$^$9(B

-------------
$BD9C+@n(B $BJ8I'(B
hek@on.rim.or.jp
 -------------
Re: _LostFocus + .SetFocus
#1196
Author: Sato Masahiro
Date: Wed, 15 Oct 1997 00:00
24 lines
1129 bytes
Windows NT 3.51 $B>e$G(B Visual Basic 4.0 $B$r;HMQ$7$F$$$k<T$G$9!#(B

In article <3444A353.7A36@ffc.co.jp>, kokubun@ffc.co.jp says...
>$B%-%c%s%;%k%\%?%s$N(B _Click $B%$%Y%s%H$@$1$O!"(B
>Text_LostFocus $B$h$jM%@h$5$;$?$$$N$G$9$,!"(B
>$B$3$N$h$&$J$3$H$O2DG=$J$N$G$7$g$&$+!#(B
>$B$b$C$HNI$$J}K!$,$"$l$P!"%R%s%H$@$1$G$b65$($F$/$@$5$$!#(B

 $B$6$C$H;n$7$?$H$3$m!"(B

(1) Command1_MouseDown
(2) Text1_LostFocus
(3) Command1_Click
(4) Command1_MouseUp

$B$N=g$G%$%Y%s%H$,H/@8$7$^$7$?!#$h$C$F!"%U%i%0$rN)$F$k$J$I(B
$B$9$k$3$H$K$h$j!"2?$H$+$G$-$=$&$J5$$,$7$^$9!#(B

 $B$J$*!"%"%/%;%9%-!<$r3d$jEv$F$k$J$i$P!"$^$?JL$NOC$K(B
$B$J$k$H;W$$$^$9!#(B

-- 
$B:4F#@59((B <masahiro@cij.co.jp>
Re: _LostFocus + .SetFocus
#1197
Author: KOKUBUN shige.
Date: Wed, 15 Oct 1997 00:00
72 lines
2441 bytes
KOKUBUN shige. wrote:
> '------$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$b$A$m$s<B:]$NH=CG=hM}$O$b$&>/$7J#;($G$9!#(J(^^;


$B<+8J%U%)%m!<$G$9!#(J(_ _)
$B$3$l$@$1C1=c2=$9$l$P!"IaDL$O2<$N$h$&$J:n$j$K$J$k$H;W$$$^$9!#(J

Private Sub Command1_Click()
    Unload Me
End Sub

Private Sub Text1_LostFocus()
    Dim i As Integer
    If Not (Text1.Text = "1") Then
        i = MsgBox("$BCM$,ITEv$G$9!#:FF~NO;~$K(J[OK]", vbQuestion +
vbOKCancel)
        If i = vbOK Then
            Text1.SetFocus
        Else
            Call Command1_Click
        End If
    End If
End Sub

$B$3$l$G!"L\E*$NF0:n$r3NG'$G$-$^$7$?!#(J


$B0J2<$O8@$$J,$1$H$$$&$+!"<:GT;vNc$G$9!#(J
$B$J$s$G!"85$N<ALd$K$J$C$F$7$^$C$?$+$H$$$&$H!"(J

$B!V(JNot (Text1.Text = "1")$B!W(J $B$NItJ,$O(J

$BH=CG4X?t(J_A()
 +-$BH=CG4X?t(J_B()
    +-$BH=CG4X?t(J_C()
       +- .SetFocus

$B$N$h$&$J!"9=B$(J($B$3$l$G$b$+$J$j4JN,(J)$B$@$C$?$N$G!"(J
$B$=$3$K$O<j$rIU$1$?$/$J$+$C$?$N$G$9!#(J

$B85=hM}$O!"(JCommand_Click$B;~$K$9$Y$F$N%A%'%C%/$r$7$F$$$?$N$G!"(J
$B>e5-$N=hM}$G$b$$$$$N$F$:$,!"H=CG$9$k(J textBox $B$NCf$GFCJL$K=EMW$J(J
$B9`L\$,$"$j!"$=$N%A%'%C%/$@$1!"(J _LostFocus $B$K0\F0$7$?$i!"NI$/$J$k$@$m$&$H(J
$B;W$C$?$N$G$7$?!#(J # $B?M$N:n$C$?=hM}$N2~B$$J$N$G(J(^^;;;

$B$G!"$=$N2~B$$,4JC1$G$O$J$$$3$H$K5$IU$$$F$N<ALd$@$C$?$N$G$9!#(J
$B8e!9$N$3$H$r9M$($F!"<j$rIU$1$?$/$J$$ItJ,$N=$@5$b$9$k;v$K$7$^$7$?!#(J

$BH=CG=hM}(J $B$H(J $BBP=h=hM}(J $B$rJ,$1$F:n@.$7$F$J$+$C$?$N$,860x$G$9!#(J
$B$*A{$,$;$7$^$7$?!#(J

-- 
$B9qJ,(J mailto:kokubun@ffc.co.jp
Re: _LostFocus + .SetFocus
#1205
Author: Terushi Arakawa
Date: Thu, 16 Oct 1997 00:00
156 lines
4618 bytes
$B9S@n(B@TSN BBS$B$G$9!#(B

KOKUBUN shige. (kokubun@ffc.co.jp) wrote:
> VB4.0 $B$r;HMQ$7$F$$$^$9!#(B
> Text_LostFocus()$B%$%Y%s%H$K$h$kF~NO%G!<%?$N%A%'%C%/=hM}$G(B
> $B%(%i!<$,$"$C$?$i(B .SetFocus $B$G:FF~NO$7$F$b$i$&;v$r9M$($^$7$?!#(B

> $B$7$+$7!"(B

> '------$B%k!<%W$9$k(B
> Private Sub Text1_LostFocus()
>     If Not (Text1.Text = "1") Then
>         Call MsgBox("$BCM$,ITEv$G$9(B", vbOKOnly)
>         Text1.SetFocus
>     End If
> End Sub

> $B$N$h$&$J=hM}$@$H!"MxMQ<T$,@5$7$$CM$rF~NO$7$J$$8B$j(B
> $B%-%c%s%;%k$G$-$J$/$J$j$^$9!#(B
> $B;EJ}$,L5$$$N$G!"2s?t$K$h$k@)8B$r@_$1$^$7$?!#(B($B"(DI2CItJ,(B)

> '------$B2s?t@)8B(B
> Dim nErrorCount As Integer '$B"((B
> Private Sub Command1_Click()
>     Unload Me
> End Sub

> Private Sub Text1_Change()
>     nErrorCount = 0  '$B"((B
> End Sub

> Private Sub Text1_LostFocus()
>     If nErrorCount > 2 Then Exit Sub  '$B"((B
>     nErrorCount = nErrorCount + 1     '$B"((B
>     If Not (Text1.Text = "1") Then
>         Call MsgBox("$BCM$,ITEv$G$9(B", vbOKOnly)
>         Text1.SetFocus
>     End If
> End Sub


> $B%-%c%s%;%k%\%?%s$N(B _Click $B%$%Y%s%H$@$1$O!"(B
> Text_LostFocus $B$h$jM%@h$5$;$?$$$N$G$9$,!"(B
> $B$3$N$h$&$J$3$H$O2DG=$J$N$G$7$g$&$+!#(B
> $B$b$C$HNI$$J}K!$,$"$l$P!"%R%s%H$@$1$G$b65$($F$/$@$5$$!#(B

$B4JC1$K$O=PMh$J$$$G$7$g$&!#(B

Private Sub Text1_LostFocus()
    If Text1.Text = "" Then Exit Sub
    If Text1.Text <> "1" Then
         MsgBox "$BCM$,ITEv$G$9(B", vbExclamation
         Text1.SetFocus
    End If
End Sub

Private Sub Command2_Click()
    If Text1.Text == "" Then
        MsgBox "Text1$B$KCM$rF~NO$7$F2<$5$$(B", vbExclamation
	Text1.SetFocus
	Exit Sub
    End If
    '$B$=$N8e$N=hM}$r$3$3$X5-F~$7$F2<$5$$(B
End Sub

$B$3$N$h$&$K$9$k$H!"F~NOI,?\$K$7$?$$(BTextBox$B$NCM$r%A%'%C%/$9$k$3$H$,(B
$B$G$-$^$9!#(B
$BCM$,6u$J$i%-%c%s%;%k%\%?%s$r2!$;$^$9$7!"(B
$B<B9T%\%?%s$r2!$9$HCM$,F~NO$5$l$F$$$J$$>l9g$O!"$=$3$X%U%)!<%+%9$,(B
$B0\$j$^$9!#(B

Dim PrevFocus As String

Private Sub Form1_Load()
    Command2.Enabled = False
End Sub

Private Sub Text1_GotFocus()
    If PrevFocus = "Text2" Or PrevFocus = "Text3" Then
        CheckAll
    End If
    PrevFocus = "Text1"
End Sub

Private Sub Text2_GotFocus()
    If PrevFocus = "Text1" Or PrevFocus = "Text3" Then
        CheckAll
    End If
    PrevFocus = "Text2"
End Sub

Private Sub Text3_GotFocus()
    If PrevFocus = "Text1" Or PrevFocus = "Text2" Then
        CheckAll
    End If
    PrevFocus = "Text3"
End Sub

Private Sub Command1_Click()
    If PrevFocus = "Text1" Or PrevFocus = "Text2" Or PrevFocus = "Text3" Then
        CheckAll
    End If
End Sub

Private Sub CheckAll() As Boolean
    If PrevFocus = "Text1" Then
        If Text1.Text <> "1" Then
            MsgBox "$BCM$,ITEv$G$9(B", vbExclamation
            Text1.SetFocus
	    Command1.Enabled = False
            CheckAll = False
	    Exit Sub
        End If
    ElseIf PrevFocus = "Text2" Then
        If Text2.Text <> "2" Then
            MsgBox "$BCM$,ITEv$G$9(B", vbExclamation
            Text2.SetFocus
	    Command1.Enabled = False
            CheckAll = False
	    Exit Sub
        End If
    ElseIf PrevFocus = "Text3" Then
        If Text3.Text <> "3" Then
            MsgBox "$BCM$,ITEv$G$9(B", vbExclamation
            Text3.SetFocus
	    Command1.Enabled = False
            CheckAll = False
	    Exit Sub
        End If
    End If

    Command1.Enabled = True
    CheckAll = True
End Sub

Private Sub Command2_Click()
    '$B<B9T%\%?%s$N=hM}$r5-F~$7$F2<$5$$(B
End Sub

$B$b$C$H$-$l$$$J9=B$$G=q$1$k$H;W$$$^$9!#(B

$B$3$s$J46$8$K$9$l$P!"A4It$NF~NO9`L\$K@5>o$JCM$,@_Dj$5$l$k$^$G!"(B
$B<B9T%\%?%s$O2!$;$J$$!#(B
$B$=$N$+$o$j$K%-%c%s%;%k%\%?%s$J$i2!$;$k!#(B

$B$H$$$C$?>uBV$r:n$j=P$;$k$H;W$$$^$9!#(B

#VB$B$N4D6-$G;n$7$?Lu$G$O$J$$$N$G$$$$$+$2$s$G$9(B
#$B%(%G%#%?$G$=$N$^$^=q$$$?$b$N$G!&!&!&(B

$B$Q$C$H;W$$IU$/$N$O$3$l$i(B2$BDL$j$NJ}K!$/$i$$$G$9!#(B
$B%R%s%H$K$J$j$^$9$G$7$g$&$+(B?
-- 
Terushi Arakawa
mailto:bosturbo@bostn.tsn.or.jp
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads