如何让一个VB窗口总是处于各窗口的最上层

前端之家收集整理的这篇文章主要介绍了如何让一个VB窗口总是处于各窗口的最上层前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

代码如下:
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

Private Sub Form_Load()   SetWindowPos Me.hwnd,HWND_TOPMOST,Me.Left/Screen.TwipsPerPixelX,_ Me.Top/Screen.TwipsPerPixelY,Me.Width/Screen.TwipsPerPixelX,_    Form1.Height / Screen.TwipsPerPixelY,0 End Sub

猜你在找的VB相关文章