制造出透明的窗体(Form)
今天图老师小编给大家精心推荐个制造出透明的窗体(Form)教程,一起来看看过程究竟如何进行吧!喜欢还请点个赞哦~
OptionExplicit
PrivateDeclareFunctionGetWindowLongLib"user32"Alias"GetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong)AsLong
PrivateDeclareFunctionSetWindowLongLib"user32"Alias"SetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong,ByValdwNewLongAsLong)AsLong
ConstGWL_EXSTYLE=(-20)
ConstWS_EX_TRANSPARENT=&H20&
PrivatePreValueAsLong
PrivateSubCommand2_Click()注释:还原变成不透明
CallSetWindowLong(Me.hwnd,GWL_EXSTYLE,PreValue)
Me.Hide
Me.Show
EndSub
PrivateSubForm_Load()
DimiAsLong
i=GetWindowLong(Me.hwnd,GWL_EXSTYLE)
注释:变成透明的Form
PreValue=SetWindowLong(Me.hwnd,GWL_EXSTYLE,iOrWS_EX_TRANSPARENT)
Me.Show
DoEvents
Command1.Refresh注释:令Command1可见
Command2.Refresh注释:令Command2可见
EndSub->