加载不可见的表单 [英] Loading an invisible form

查看:74
本文介绍了加载不可见的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在VB.NET中加载隐藏的表单?似乎没有设计

时间可见属性是什么?

How does one load a hidden form in VB.NET? There doesn''t seem to be a design
time "visible" property any more?

推荐答案

您可以使用Form类的Hide和Show方法。


-

Carsten Thomsen

社区 - http: //community.integratedsolutions.dk

---------

Voodoo编程:程序员做的事他们知道不应该工作但无论如何他们都会尝试
,有时实际上会工作,例如重新编译

所有内容。 (Karl Lehenbauer)

---------

" Dan" < Da*@discussions.microsoft.com>在消息中写道

新闻:8C ********************************** @ microsof t.com ...
You can use the Hide and Show methods of the Form class.

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk
---------
Voodoo Programming: Things programmers do that they know shouldn''t work but
they try anyway, and which sometimes actually work, such as recompiling
everything. (Karl Lehenbauer)
---------
"Dan" <Da*@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
如何在VB.NET中加载隐藏的表单?似乎没有一个
设计时间可见。属性?
How does one load a hidden form in VB.NET? There doesn''t seem to be a
design
time "visible" property any more?



我刚刚尝试过,并得到了一个创建窗口句柄的错误。运行以下代码时,

SendMessage调用异常:

私有声明函数SendMessage Lib" user32"别名SendMessageA

(ByVal hwnd As Integer,ByVal wMsg As Integer,ByVal wParam As Integer,ByVal

lParam as Integer)As Integer


Dim testform As New Form2

testform.Hide()

SendMessage(testform.Handle.ToInt32,& H8000,0,0)


有人知道发生了什么吗?


" CT"写道:
I just tried that, and got an "Error creating window handle" exception on the
SendMessage call when running the following code:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal
lParam As Integer) As Integer

Dim testform As New Form2
testform.Hide()
SendMessage(testform.Handle.ToInt32, &H8000, 0, 0)

Anybody know what''s going on?

"CT" wrote:
您可以使用Form类的Hide和Show方法。

-
Carsten Thomsen
社区 - < a rel =nofollowhref =http://community.integratedsolutions.dktarget =_ blank> http://community.integratedsolutions.dk
-------- -
Voodoo编程:事情程序员这样做,他们知道不应该工作,但他们无论如何都会尝试,有时候实际工作,比如重新编译一切。 (Karl Lehenbauer)
---------
丹 < Da*@discussions.microsoft.com>在消息中写道
新闻:8C ********************************** @ microsof t.com。 ..
You can use the Hide and Show methods of the Form class.

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk
---------
Voodoo Programming: Things programmers do that they know shouldn''t work but
they try anyway, and which sometimes actually work, such as recompiling
everything. (Karl Lehenbauer)
---------
"Dan" <Da*@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
如何在VB.NET中加载隐藏的表单?似乎没有一个
设计时间可见。属性?
How does one load a hidden form in VB.NET? There doesn''t seem to be a
design
time "visible" property any more?




Dan,


您可以更改API声明:


私有声明函数SendMessage Lib" user32"别名SendMessageA

(ByVal hwnd As IntPtr,ByVal wMsg As Integer,ByVal wParam As Integer,ByVal

lParam as Integer)As Integer


-

Carsten Thomsen

社区 - http://community.integratedsolutions.dk

---------

Voodoo编程:程序员这样做他们知道不应该工作,但是无论如何他们都会尝试工作,而且有时实际工作,例如重新编译

所有东西。 (Karl Lehenbauer)

---------

" Dan" < Da*@discussions.microsoft.com>在消息中写道

新闻:3D ********************************** @ microsof t.com ...
Dan,

You can change the API Declare to this:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal
lParam As Integer) As Integer

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk
---------
Voodoo Programming: Things programmers do that they know shouldn''t work but
they try anyway, and which sometimes actually work, such as recompiling
everything. (Karl Lehenbauer)
---------
"Dan" <Da*@discussions.microsoft.com> wrote in message
news:3D**********************************@microsof t.com...
我刚刚尝试过,并得到了一个创建窗口句柄的错误。
运行以下代码时的SendMessage调用异常:

私有声明函数SendMessage Lib" user32"别名SendMessageA
(ByVal hwnd As Integer,ByVal wMsg as Integer,ByVal wParam as Integer,
ByVal
lParam as Integer)as Integer

昏暗的testform作为New Form2
testform.Hide()
SendMessage(testform.Handle.ToInt32,& H8000,0,0)

任何人都知道发生了什么?

CT写道:
I just tried that, and got an "Error creating window handle" exception on
the
SendMessage call when running the following code:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer,
ByVal
lParam As Integer) As Integer

Dim testform As New Form2
testform.Hide()
SendMessage(testform.Handle.ToInt32, &H8000, 0, 0)

Anybody know what''s going on?

"CT" wrote:
您可以使用Form类的Hide和Show方法。

-
Carsten Thomsen
社区 - < a rel =nofollowhref =http://community.integratedsolutions.dktarget =_ blank> http://community.integratedsolutions.dk
-------- -
Voodoo编程:程序员做的事情他们知道不应该工作
但是他们无论如何都会尝试,有时候实际工作,比如重新编译一切。 (Karl Lehenbauer)
---------
丹 < Da*@discussions.microsoft.com>在消息中写道
新闻:8C ********************************** @ microsof t.com。 ..
You can use the Hide and Show methods of the Form class.

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk
---------
Voodoo Programming: Things programmers do that they know shouldn''t work
but
they try anyway, and which sometimes actually work, such as recompiling
everything. (Karl Lehenbauer)
---------
"Dan" <Da*@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
>如何在VB.NET中加载隐藏的表单?似乎没有
>设计
>时间可见属性?
> How does one load a hidden form in VB.NET? There doesn''t seem to be a
> design
> time "visible" property any more?




这篇关于加载不可见的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆