当其他形式的文本框获得焦点时显示表单 [英] Show a Form when a textbox in other form got focus

查看:45
本文介绍了当其他形式的文本框获得焦点时显示表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我在Windows XP上使用VB 6.


我试图显示一个名为prodListFrm的表单。 ,当一个名为prod1Txt的文本框时,放在名为customerFrm的另一个表单上。但是,正在发生的是表单无限次加载。这是代码: -


Private Sub prod1Txt_gotfocus()

prodListFrm.Show vbModal

prod1Txt.Text = prodListFrm.List1 .Text

End Sub


Private Sub prod1Txt_LostFocus()

卸载prodListFrm

结束Sub < br $>

如何解决这个问题?


请尽快帮助我。


谢谢!

Hello everyone!

I am using VB 6 on Windows XP.

I tried to show a form named "prodListFrm", when a textbox named "prod1Txt" placed on another form named "customerFrm". But, it is happening that the form is loading for infinite times. Here is the code:-

Private Sub prod1Txt_gotfocus()
prodListFrm.Show vbModal
prod1Txt.Text = prodListFrm.List1.Text
End Sub

Private Sub prod1Txt_LostFocus()
Unload prodListFrm
End Sub

How can I rectify this Problem?

Please help me asap.

Thank You!

推荐答案

不确定我是否理解正确。我假设您希望此表单不会被反复加载。


试试这个:

Not sure if I understood you correctly. I assume that you want this form not to be loaded over and over again.

Try this:

展开 | 选择 | Wrap | 行号



不确定我是否理解正确。我假设您希望此表单不会被反复加载。


试试这个:

Not sure if I understood you correctly. I assume that you want this form not to be loaded over and over again.

Try this:

展开 | 选择 | Wrap | 行号


select语句返回的记录数是多少? SQL服务器到底有多远?

我的意思是数据通过网络,例如从东京到伦敦。


我的观点是你加载了一次记录并隐藏此表单并保留所有数据以供下次使用。如果卸载表单,则需要返回数据库收集记录并重新加载。


这种负载在哪种情况发生?
How many records returned by your select statement? How far SQL server is?
I mean does data go through a network like for example from Tokyo to London.

My point was that you load records once and just hide this form and keep all data ready for the next use. If you unload form you need to go back to a database collect records and load them again.

In which event this load happening?


这篇关于当其他形式的文本框获得焦点时显示表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆