CodePudding user response:
Build a no borders form, cloth good inningsPrivate 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
Private Const HWND_TOPMOST & amp;=1
'put the window at the top of the list, and the top in any window in the front of the
Private Const SWP_NOSIZE & amp;=& amp; H1
'keep the window size
Private Const SWP_NOMOVE & amp;=& amp; The H2
'
keep window position
Private Sub Form_Load ()
SetWindowPos Me. The HWND, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
'the window is set to always on top
End Sub
The above code from baidu know
CodePudding user response:
Form2. Show vbModalCodePudding user response:
A window can be casuallyFormA. Show vbmodal
You can create a global function MyMsgBox it calls the formA. Show vbmodal, so can and MsgBox effect
CodePudding user response:
Form2. Show vbModalForm2. Show 1
CodePudding user response:
Show method
To show the MDIForm or the Form object, does not support named parameters,
Syntax
Object. The Show style, ownerform
Show method syntax includes the following parts:
Part of the description
Object optional, an object expression, its value is "applied" in the list of an object, if you omit the object, the default is associated with activity form module form object,
Style optional, an integer, it is used to determine the form mode or not, if the Style is 0, the form is no pattern; If the style is 1, the form is pattern,
Ownerform optional, string expression, and points out that the component's form is displayed, for a standard Visual Basic form, using keywords Me,
Description
If the call Show method when the specified form is not loaded, Visual Basic will automatically load the form,
When the Show shows no pattern form, and then meet the code is to be performed, when the Show on the display mode form (modal form), the subsequent code until the form is hidden or unloaded to execute,
When the Show on the display mode form, in addition to the model objects in the form cannot be input (keyboard or mouse click), the other form to input before the program must hide or uninstall mode form (usually in response to user some operating status), MDIForm can't be in the form of,
When model window display, while other forms of application failure, but other applications will not fail,
Application startup form after the call will automatically appear in the Load event,
The following example shows how to use ownerform parameters:
Private Sub cmdShowResults_Click ()
'display mode form frmResults.
FrmResults. Show vbModal, Me
End Sub
CodePudding user response:
Form2. Show 1
Agree to
CodePudding user response:
Can use the Show method to solve, such as:Form1. Show 1