How to reference a cobtrol in a diferent form

  • Thread starter Thread starter Carlos
  • Start date Start date
C

Carlos

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 said:
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

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.
 
Do you have any sample code ?

Herfried K. Wagner said:
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, I can even *hear* you crying.

*LOL*

;->

(Carlos, despite the question was very ok)
 
Hi Armin,

I ask that before on Herfried, you know I never get answers from him, have
to use another name for that.

What does that

;->

Mean instead of a :-) or a :-(

Cor
 
* "Armin Zingler said:
Herfried, I can even *hear* you crying.

*LOL*

Yes, I am crying. I don't have any hairs on my head any more... But I
am still waiting for your article!

;-)
 
Cor,

* "Cor said:
I ask that before on Herfried, you know I never get answers from him, have
to use another name for that.

Sorry, my newsreader has problems showing old threads, that's why I
sometimes miss your posts if you are replying to a thread which is more
than ~30 hours old. I feel sorry for that!
What does that

;->

Sarcasm.
 
* "Armin Zingler said:
I gave up. Didn't know where to start (and above all where to stop).

I know it's possible to write a book about that. If you write chapters
1-12, then I'll write the preface.

;-)
 
Write?

or Paste?

I think Armin writes easier that 12 chapters than you the preface

Just Kidding

Cor
 
* "Cor said:
Write?

or Paste?

I think Armin writes easier that 12 chapters than you the preface

Just Kidding

:-)

Do you want to write a chapter too? Maybe the web forms part?

Just kidding too.
 
Herfried K. Wagner said:
:-)

Do you want to write a chapter too? Maybe the web forms part?

Just kidding too.


Yeah, and we will earn a lot of money.

Just kidding too. *LOL*
 
If he has a free server I make it from him if he wants.

Not that much work, and if he has IIS and aspnet, than real full aspx.
 
* "Cor said:
If he has a free server I make it from him if he wants.
:-)

Not that much work, and if he has IIS and aspnet, than real full aspx.

:-) again.
 
Back
Top