Calling inherited form - form loads and is a creature somewhat lik

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I don't know what I am doing wrong - I have two forms, I will call them A and
B. B is a class inherted from A. I am calling B from A with B.ShowDialog().
When B loads, it is a creature somewhat like the first form and the form it
should be. Some of the controls from A are now on B and fully functional.
Why are they showing up on my new form? It only seems to happen when B is
inherited from A. Hope this isn't confusing. Thank you.
 
nidget said:
I don't know what I am doing wrong - I have two forms, I will call them A
and
B. B is a class inherted from A. I am calling B from A with
B.ShowDialog().
When B loads, it is a creature somewhat like the first form and the form
it
should be. Some of the controls from A are now on B and fully functional.
Why are they showing up on my new form? It only seems to happen when B is
inherited from A. Hope this isn't confusing. Thank you.

This is what is meant to happen. You chose to inherit from A so B gets the
controls of A. Why did you inherit from A?

Michael
 
Thank you for your response. The reason I am inheriting is because I want to
be able to access a variable that I am using in the other class. Is there
another way to make the variable in class A visible to class B? Thank you.
 
Back
Top