天哪,这是图上看出来的?
比如:
Private Sub Form1_Load()
Form2.Show vbModal
End Sub
好象就可以
这样的话,无法使Form1获得焦点呀.
请大家仔细看窗体啊!!!尤其是标题栏的颜色!!!
图片看不见的话请点击图片看大图,如果还看不见的话,在图片上悬停一会儿,右下方会出现"扩展为常规大小按钮",点了就看清楚了.
本帖版权归ryu所有.如果引用本帖,请注明帖子的出处和作者;本帖如系引用,其版权归原作者所有.
天哪,这是图上看出来的?
比如:
Private Sub Form1_Load()
Form2.Show vbModal
End Sub
好象就可以
这样的话,无法使Form1获得焦点呀.
请大家仔细看窗体啊!!!尤其是标题栏的颜色!!!
图片看不见的话请点击图片看大图,如果还看不见的话,在图片上悬停一会儿,右下方会出现"扩展为常规大小按钮",点了就看清楚了.
Option Explicit
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 Sub Form_Load()
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
Option Explicit
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 Sub Form_Load()
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
还是没解决,好好看图呀!!!
谢啦!!!
我的天搞了半天也不明白,今天偶然一查MSDN终于知道怎么弄了:
Form1.Show vbModeless, Me
很简单么-_-