表单打开时运行代码 [英] Run code when form opens

查看:61
本文介绍了表单打开时运行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个表单,我希望我的代码在表单打开时自动运行.

更好的是,我打开表单,代码开始运行.

我已经尝试将代码放入Form_load函数中,但是在这里代码开始了,但是表单没有显示

我正在使用Visual c ++ 2010

I''ve created a form and i want my code to run automatically when form opens.

Better, I open the form and the code begins to run.

I''ve tried putting the code in Form_load function but in here the code starts but the form isn''t shown

I''m using visual c++ 2010

推荐答案

,所以您的意思是要在显示表单后运行代码.在这种情况下,请尝试使用显示 [
So you mean that you want to run the code after the form is shown. In that case try using Shown[^] event.

However not that the UI will not be responding to user actions unless you run the code in another thread.


这篇关于表单打开时运行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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