8759.html
来自「以电子书的形式收集了VB一些常见问题解决方法,可以很方便的查找自己需要解决的问题」· HTML 代码 · 共 23 行
HTML
23 行
<html>
<head>
<title>Re: 有 lostfocus , 无 getfocus</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Re: 有 lostfocus , 无 getfocus</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by jutso on December 31, 1998 at 15:13:00:<p>
In Reply to: <a href="8757.html">有 lostfocus , 无 getfocus</a> posted by jutso on December 31, 1998 at 14:42:24:<p>
我又把程式改成这样:<br>Private Sub Text1_LostFocus()<p> Debug.Print "text1 lostfocus"<br> <br> MsgBox "text1 lost focus"<br> If Form1.ActiveControl Is Text2 Then<br> Debug.Print "active control is text2"<br> End If<br> <br> Text1.SetFocus<br> <br> DoEvents<br>End Sub<p>Private Sub Text2_GotFocus()<p> Debug.Print "text2 getfocus"<p>End Sub<p>Private Sub Text2_LostFocus()<p> Debug.Print "text2 lostfocus"<br> <br> MsgBox "text2 lost focus"<br> If Form1.ActiveControl Is Text1 Then<br> Debug.Print "active control is text1"<br> End If<br> <br> Text2.SetFocus<br> DoEvents<p>End Sub<p> 也就是说在执行 text1_lostfocus 时,activecontrol<br>已经是 text2,但是为何 text2 的 getfocus 事件都没出现?<p>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 8759-->
</ul><!--end: 8759-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?