开发者

VB run code on start of the application

I am a Java programmer and don't know much about VB.

My task:

开发者_JS百科 Create an exe. When I run the exe it will read a text file, and after that it will display the content. After that the application code ends.

What i have done:

I have created a project and created a button on the form. On click of the button I have given the option to read.

Problem

I am not able to find the event which has to be used to run code on start up and code to end the application when my task completes.

Please help me with the process which I have to follow. If the code is provided, it's best, but if somebody knows any web resources it will also be a great help.


You can create a Visual Basic 6 program to run without any form.

You need to create a module. Put a Public Sub Main inside of it.

Then in under Project Properties, General Tab; change the startup object to be Sub Main.


To do something at form's start up, use Form_Load() event.

To close a form, use unload me.

To close your application, use end.

Hope this solves your problem. If not, you are welcome for further queries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜