求vb6中让窗体一直保持在最前的代码
展开全部
这个简单,不就个窗体置前么!
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
const
hwnd_topmost
=
-1
const
swp_nomove
=&h2
const
swp_nosize
=&h1
const
swp_nozorder
=&h8
sub
setformtopmost(theform
as
form)
setwindowpos
theform.hwnd,
hwnd_topmost,
0,
0,
0,
0,
_swp_nozorder
+
swp_nomove
+
swp_nosize
end
sub
sub
form_load()
setformtopmost
me
''只需要改动这里,me换成你想放在最前的窗体名
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
const
hwnd_topmost
=
-1
const
swp_nomove
=&h2
const
swp_nosize
=&h1
const
swp_nozorder
=&h8
sub
setformtopmost(theform
as
form)
setwindowpos
theform.hwnd,
hwnd_topmost,
0,
0,
0,
0,
_swp_nozorder
+
swp_nomove
+
swp_nosize
end
sub
sub
form_load()
setformtopmost
me
''只需要改动这里,me换成你想放在最前的窗体名
end
sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询