发新话题
打印

急求窗口问题,请高手指教

建一个全屏的窗口,将窗口设计为最上层就可以了。

在窗体的代码最上面加上下面的声明:
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

Const HWND_TOPMOST = -1
Const HWND_TOP = 0
Const SWP_SHOWWINDOW = &H40

在窗体启动的时候(Form_Load事件中)加上代码
    SetWindowPos Me.hwnd, HWND_TOPMOST, Me.Left \ Screen.TwipsPerPixelX, Me.Top \ Screen.TwipsPerPixelY, Me.Width \ Screen.TwipsPerPixelX, Me.Height \ Screen.TwipsPerPixelY, 0

TOP

发新话题