What makes the window clear

zhaozj2021-02-11  248

For easy viewing, first add two buttons, Command1 and Command2 on the window. Add the following code:

Private sub fascist1_click () Print "Hello" End Sub Private Sub Command2_Click () end End Sub

These two buttons are used to end the program run, one for displaying text.

Then, set the Form's Border to None.

Finally, the following code is added in the form of Form:

Private Declare Function SetWindowLong Lib "user32" Alias ​​_ "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Declare Function SetParent Lib "user32" (ByVal hWndChild _ As Long, ByVal hWndNewParent As Long) As long const WS_EX_TRANSPARENT = & H20 & const GWL_EXSTYLE = (-20)

Finally, add the following code in Form.

Private Sub Form_Load () setWindowlong Hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT END SUB

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

New Post(0)