1 object on 2 different Form objects

  • Thread starter Thread starter xnn
  • Start date Start date
X

xnn

Hi,

I would like to know why an object Label cannot be used on
2 different object Forms at the same time?
It has the impct of run-time error.

Thank you very much.


regards
 
xnn, what is the error that you are seeing? Are you creating a label object
and then trying to add it to both forms? You are right, it is illegal for a
label to have more than one parent control. One label cannot belong to the
ControlCollection of multiple forms. Why not just create another label?
 
Hi Greg,

Thanks for your reply.
The reason I do not want to create another label is this.
I have also another button and textbox which I want them
to have the same behavior on 2 different forms.

If I create different ones, says:
1) Button1 and TextBox1
2) Button2 and TextBox2
and whatever changes to TextBox1 should be reflected in
TextBox2. If using 2 different objects, then I have to
maintain 2 different methods of the same functionality and
it is hard to maintain later on.

Any idea would be appreciated.
Thank you.


regards
 
Back
Top