如何以不同的形式引用一种cobtrol [英] How to reference a cobtrol in a diferent form

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

问题描述

之前在VB 6之前,我曾经参考过一个进度条1进入

之后


Form1.ProgressBar1.val = 1


现在如果控件是以不同的形式用于
,如何为模块引用控件


谢谢

Before in VB 6 I used to reference for examplea progressbar1 doin the
following

Form1.ProgressBar1.val =1

Now how do I refrence a control for a module if the control is in a
different form

Thanks

推荐答案

*" Carlos" < CP **** @ yahoo.com> scripsit:
* "Carlos" <cp****@yahoo.com> scripsit:
在VB 6之前,我曾经参考过一个进度条1在
之后

Form1.ProgressBar1.val = 1
现在,如果控件处于不同的形式,我如何引用模块的控件
Before in VB 6 I used to reference for examplea progressbar1 doin the
following

Form1.ProgressBar1.val =1

Now how do I refrence a control for a module if the control is in a
different form




您必须传递对表单的引用为了更改

控件的属性。如何做到这一点取决于场景:

如果您在主表单中显示包含

进度条的第二个表单,您可以添加一个属性

对话框的主要表单类型,并设置此属性以引用主表单实例,然后再显示第二个表单




-

Herfried K. Wagner [MVP]

< http://www.mvps.org/dotnet>



You will have to pass a reference to the form in order to change the
control''s properties. How this can be done, depends on the scenario:
If you are showing the 2nd form from your main form which contains the
progressbar, you can add a property of the type of the main form to your
dialog and set this property to reference the main form instance before
showing the 2nd form.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


你有任何示例代码吗?


" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道

news:bv ************ @ ID-208219.news.uni-berlin.de ...
Do you have any sample code ?

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bv************@ID-208219.news.uni-berlin.de...
* "卡洛斯" < CP **** @ yahoo.com> scripsit:
* "Carlos" <cp****@yahoo.com> scripsit:
在VB 6之前,我曾经参考过一个进度条1在
之后

Form1.ProgressBar1.val = 1
现在,如果控件处于不同的形式,我如何为模块引用控件
Before in VB 6 I used to reference for examplea progressbar1 doin the
following

Form1.ProgressBar1.val =1

Now how do I refrence a control for a module if the control is in a
different form



您必须传递对表单的引用才能更改
控制'的属性。如何做到这一点,取决于场景:
如果你在主表单中显示包含
进度条的第二个表单,你可以添加一个主表单类型的属性到你的
对话框并设置此属性以在
显示第二个表单之前引用主表单实例。

-
Herfried K. Wagner [MVP]
< ; http://www.mvps.org/dotnet>



You will have to pass a reference to the form in order to change the
control''s properties. How this can be done, depends on the scenario:
If you are showing the 2nd form from your main form which contains the
progressbar, you can add a property of the type of the main form to your
dialog and set this property to reference the main form instance before
showing the 2nd form.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>



*" Carlos" < CP **** @ yahoo.com> scripsit:
* "Carlos" <cp****@yahoo.com> scripsit:
你有任何示例代码吗?




例如:


< http://www.google.de/groups?selm=uh87DfymDHA.3504%40TK2MSFTNGP11.phx.gb l>


-

Herfried K.瓦格纳[MVP]

< http://www.mvps.org/dotnet>



For example:

<http://www.google.de/groups?selm=uh87DfymDHA.3504%40TK2MSFTNGP11.phx.gb l>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


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

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