-
In form1, use the following you** and you're good to go.
private sub command1_click()0
0end sub
-
The question ... It doesn't seem to be solved... Looking forward to the masters...
-
Try this and see:
If you succeed, you have to give extra points, hehe.
-
It can be solved using the setwindowpos function.
-
When vb uses the show method to display the form, the style attribute is set to 1, so that the displayed form can be displayed as a mode form.
show method to display the MDIform or Form object. Named parameters are not supported.
DescriptionIf the form specified when the show method is called is not loaded, Visual Basic
The form is automatically loaded.
When show is displaying a modeless form, the subsequent ** is executed. When show is displayed in the modal form
, the subsequent ** cannot be executed until the form is hidden or uninstalled.
When show is displayed in a modal form, no input (keyboard or mouse click) can be made other than objects in the modal form. Before entering other forms, the program must hide or uninstall the modal form (usually in a state that responds to some action by the user). MDIform can't be formal.
When a modal form is displayed, while other forms in the application are invalidated, the other applications are not.
Note If the form is displayed as a modal dialog box, it can only be executed after the show method when the dialog box is closed. However, when a form is displayed as a modeless dialog, after the form is displayed, show
The ** after the method will be executed shortly.
-
Is it a display form?
The name of the form. show
-
'Add a command1 button to form1 to private sub command1 click()1
end sub
-
form2**。
option explicit
private const hwnd_topmost = -1private const hwnd_notopmost = -2private declare function setwindowpos lib "user32" (byval hwnd as long, byval hwndinsertafter as long, byval x as long, byval y as long, byval cx as long, byval cy as long, byval wflags as long) as long
Then this is pinned, and when form2 is opened, it is called
setwindowpos , hwnd_topmost, 0, 0, 0, 0, swp_nomove or swp_nosize
When closing form2, use this to unpin:
setwindowpos , hwnd_notopmost, 0, 0, 0, 0, swp_nomove or swp_nosize
-
At the same time as clicking the button to pop up form2, it will be written in the form2 unload event, if you don't want to hide, use =false true to do.
-
It's called a pattern form that is used when it's displayed.
private sub command1_click()1
end sub
It's very simple, you don't close form2, you go to form1 and it doesn't work.
-
private sub form_load()1
end sub
That's what you want.
-
A form is a rectangle that can be reshaped and sized by holding down the border of the form, and dragging by holding down the top part.
The entire box that you see when the browser opens is a form or window.
Modules are also part of the application, and the public variables you declare in the module can be used in any window of the same project or project.
-
According to the VB help file, there are 3 types of modules in VB: form module, standard module, and class module.
None of the modules are linked to a file, and the 3 modules correspond to 3 different types of files. Form modules are stored in files with the extension frm, standard modules are stored in files with the extension bas, and class modules are stored in files with the extension cls.
The three types of modules are described as follows:
1。A simple program has only one module, and the ** of the program at this time is stored in this form module. The form module is the basis of most VB programs.
2。For complex programs, forms can be added. In order to avoid duplication, you can centralize the common ** that is used in multiple forms and store them in an independent module, which becomes a standard module.
Multiple standard modules can also form a module library. The public variables and constants that are known in standard modules are global variables and constants that are valid throughout the project.
3。Class modules are the foundation of object-oriented programming. Users can use the class module to create their own objects with properties and methods.
A form is also a class module, a module that can display a form, and you can drag and drop controls onto the form. Neither the general class module nor the standard module has a visible user interface (form).
4。The lifetime of data in a standard module is the same as that of an project. The lifetime of the data in a class module is the same as the lifetime of a pair of classes, which is created as an object of that class is created and disappears as an object of that class disappears.
5。When a variable is advertised as public in a standard module, it is visible (valid) anywhere in the project. When a variable is declared public in a class module, access to that variable outside the module is restricted, and only those variables that have references can be accessed.
-
You double-click on the form to go in and see the available area.
Your ** is not good in itself, move slowly Unless it is directX programming, in other cases, please use timer instead of directly using loops, otherwise the CPU usage will be very high. >>>More
public variable or the name of the form. Object. Properties|Method.
Two methods:1Add an array of controls with the load method, provided you have to add a control to the form at design time and set its index property to 0, then use : >>>More
When you call it for the second time, it will automatically re-form load.,In fact, the form is closed and opened.,If you don't believe it, you can check the log from load to verify it.。 >>>More
Find a way to deal with it:
Check whether the filename is an empty string, if it is, do not perform the following operations. >>>More