首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

vb中怎么让一个窗口置在顶端

2012-02-13 
vb中如何让一个窗口置在顶端?声名如下:Private Declare Function SetWindowPos Lib user32 (ByVal hwnd

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

放到时钟控件里和窗口加载里为何不行呢?
Private Sub Timer1_Timer()
  retValue = SetWindowPos(Me.hwnd = True, HWND_TOPMOST = -1, Me.CurrentX, Me.CurrentY, 160, 200, SWP_SHOWWINDOW)  
End Sub
Private Sub Form_Load()
  retValue = SetWindowPos(Me.hwnd = True, HWND_TOPMOST = -1, Me.CurrentX, Me.CurrentY, 160, 200, SWP_SHOWWINDOW)  
End Sub

请各位老师帮忙看看那里不对!谢谢。


[解决办法]
rivate Sub Form_Load()
SetWindowPos(Me.hwnd , -1,0, 0, 0, 0, 3)

End Sub

[解决办法]

探讨
声名如下:
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……

热点排行