Form1 set as follows:
void __fastcall TForm1: : CreateParams (TCreateParams& Params)
{
TForm: : CreateParams (Params);
Params. ExStyle |=WS_EX_TOOLWINDOW;
Params. ExStyle |=WS_EX_TOPMOST;
Params. WndParent=0;
}
This question looks be like simple, please answer the test again
CodePudding user response:
No one knowCodePudding user response:
When multiple model window use lz main code, there will be some problems, so, I usually do it:void __fastcall TForm1: : FormCreate (TObject * Sender)
{
If (FormStyle!=fsStayOnTop)
{
TFormStyle TFormStyle=FormStyle;//before you begin to remember the original Settings
FormStyle=fsStayOnTop;//let the window is always in the front (transferred to the front, would have been effective, after may cause model form the pop-up interface in the case of suspected lock)
FormStyle=tFormStyle;//restore original Settings
}
}
CodePudding user response:
The above code in Form2 Form1 used my exampleCodePudding user response:
The measured once, don't know the two forms are used:
Params. ExStyle |=WS_EX_TOOLWINDOW;
Params. ExStyle |=WS_EX_TOPMOST;
Params. WndParent=0;
In the code that meet the requirements?