注釋:form上有Command1,command2兩個Button並事先設定form之BorderStyle=0
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->