VisualBasic制作透明的表单(Form)
今天天气好晴朗处处好风光,好天气好开始,图老师又来和大家分享啦。下面给大家推荐VisualBasic制作透明的表单(Form),希望大家看完后也有个好心情,快快行动吧!
ConstGWL_EXSTYLE=(-20)
ConstWS_EX_TRANSPARENT=&H20&
ConstSWP_FRAMECHANGED=&H20
ConstSWP_NOMOVE=&H2
ConstSWP_NOSIZE=&H1
ConstSWP_SHOWME=SWP_FRAMECHANGEDOrSWP_NOMOVEOrSWP_NOSIZE
ConstHWND_NOTOPMOST=-2
PrivateDeclareFunctionSetWindowLongLib"user32"Alias"SetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong,ByValdwNewLongAsLong)AsLong
PrivateDeclareFunctionSetWindowPosLib"user32"(ByValhwndAsLong,ByValhWndInsertAfterAsLong,ByValxAsLong,ByValyAsLong,ByValcxAsLong,ByValcyAsLong,ByValwFlagsAsLong)AsLong
在Form_Load使用的范例如下:
PrivateSubForm_Load()
SetWindowLongMe.hwnd,GWL_EXSTYLE,WS_EX_TRANSPARENT
SetWindowPosMe.hwnd,HWND_NOTOPMOST,0&,0&,0&,0&,SWP_SHOWME
Me.Refresh
EndSub->