是否可以创建一个半透明的表单,它应该在任何打开的窗口上可见,而不是隐藏在后面?请指导!
当然,请参阅Karl Peterson的“半透明”示例:
http://vb.mvps.org/samples/Translucent/
要使表单在其他窗口中可见,您需要使用SetWindowPos API函数.
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long,ByVal hWndInsertAfter As Long,ByVal x As Long,ByVal y As Long,ByVal cx As Long,ByVal cy As Long,ByVal wFlags As Long) As Long Private Const HWND_TOPMOST = -1 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const OnTopFlags = SWP_NOMOVE Or SWP_NOSIZE Public Sub FormOnTop(frm As Form) Call SetWindowPos(frm.hWnd,HWND_TOPMOST,0&,OnTopFlags) End Sub