Inherited Form Question

A

Amit D.Shinde

I am having Form1 in my application having controls
Button1,textbox1,button2

and Form2 is inherited form of Form1
In this form2 i have its own controls Button3.
Now when I run my Program I don't want to see Button2 of Form1.
i.e My form2 should contain Button1 Textbox1 and Button3 only.
Please Help Me

Amit D Shinde
 
A

Armin Zingler

Amit D.Shinde said:
I am having Form1 in my application having controls
Button1,textbox1,button2

and Form2 is inherited form of Form1
In this form2 i have its own controls Button3.
Now when I run my Program I don't want to see Button2 of Form1.
i.e My form2 should contain Button1 Textbox1 and Button3 only.

If you don't need button2 in Form2 at all, inheritance is perhaps not the
right way (but it can be). To hide button2, set button2.visible = false in
the constructor of Form2 or in OnLoad.
 
H

Herfried K. Wagner [MVP]

Amit D.Shinde said:
I am having Form1 in my application having controls
Button1,textbox1,button2

and Form2 is inherited form of Form1
In this form2 i have its own controls Button3.
Now when I run my Program I don't want to see Button2
of Form1. i.e My form2 should contain Button1 Textbox1
and Button3 only.

Set its 'Visible' property to 'False'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top