多种形式 [英] multiple forms

查看:103
本文介绍了多种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,快问你,我有这个代码:


[code language =" vb"]

Dim frm As Form

frm.WindowState = FormWindowState.Normal

[/ code]


我将表单初始化并最小化,所以不是这样,但它给了我一个错误,说对象引用未设置为对象的实例。

我做错了什么?任何帮助都会很棒

解决方案




在vb.net 2002和2003中不会参考开放表格。你需要对表格进行参考或使用新关键字。


dim frm as new form




dim frm as form = me


Ken

----- ---------

" iwdu15" < IW **** @ discussions.microsoft.com>在消息中写道

news:91 ********************************** @ microsof t.com ...

嘿,快问你,我有这个代码:


[code language =" vb"]

Dim frm As Form

frm.WindowState = FormWindowState.Normal

[/ code]


和i我的表单初始化和最小化,所以不是这样,但它给了我一个错误说对象引用没有设置为对象的实例。

什么是我做错了?任何帮助都会很棒


Ken,

dim frm as form = me



之前我还没有见过这个。


虽然这是一个有点奇怪的代码,但在我看来是不错的

一,它直接解释会发生什么。


Cor


对我的帖子嗤之以鼻,我做了一个错字,代码我具体如下:


Dim frm as form1

frm.WindowState = FormWindowState.Normal


和关于它被初始化等等仍然是正确的,对不起

这个错误


hey, quick question for you, i have this code:

[code language="vb"]
Dim frm As Form
frm.WindowState = FormWindowState.Normal
[/code]

and i have my form initialized and minimized so tis not that, but it gives
me an error saying "object reference not set to an instance of an object".
what am i doing wrong? any help would b awsome

解决方案

Hi,

In vb.net 2002 and 2003 that will not reference the open form. You
need to have a reference to the form for it work or use the new keyword.

dim frm as new form

or

dim frm as form = me

Ken
--------------
"iwdu15" <iw****@discussions.microsoft.com> wrote in message
news:91**********************************@microsof t.com...
hey, quick question for you, i have this code:

[code language="vb"]
Dim frm As Form
frm.WindowState = FormWindowState.Normal
[/code]

and i have my form initialized and minimized so tis not that, but it gives
me an error saying "object reference not set to an instance of an object".
what am i doing wrong? any help would b awsome


Ken,

dim frm as form = me


I have not seen this one before.

Although that it is a little bit strange code, is it in my opinion a nice
one, it explains direct what happens.

Cor


Sry about my post, i made a typo, the code i have is as follows:

Dim frm as form1
frm.WindowState = FormWindowState.Normal

and the rest is still true about it being initialized and such, sorry for
the mistake


这篇关于多种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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