VB new discovery

xiaoxiao2021-03-06  60

I recently I found that VB actually provided a Main function entry when I developed a VB program. I always think that Win32 applications written with VB are in the entrance of a form as the entire program. If there is no form, then it is not a Complete program. This concept should be corrected, no form, the program can run.

If you define a publician main function in Modules, and point Startup Object points to Sub Main in the Project Properties option window in the Project menu, then your program will start from the main function. Have you want to display a form One way is to directly call the name of the form class, another method is to create a new object for the form class. In fact, the FORM in VB is also class, and our newly built, each form is inherited from the same parent class. But why does VB do not put them in the Class Modules? This is because we created custom Form, VB will be generated by a derived way of compiler hidden, although it does not use the keyword of IMPLEments. But it is derived From the parent class form, from form_load (), Form_Mousemove (), you can see the Ni.form class to encapsulate some common system messages into a specific function, and the user is created by the user The Form class is defined. Unfortunately, not all messages are mapped. In addition, VB will create an object that is the same as the custom Form class name for use by default for users, but pay attention to form_initialize () is not class Constructor.

转载请注明原文地址:https://www.9cbs.com/read-112775.html

New Post(0)