PC Review


Reply
Thread Tools Rate Thread

Form Inheritance

 
 
Alij
Guest
Posts: n/a
 
      20th Nov 2007
Hi,

I have a simple form with two TextBox controls and two Button controls. I
have inherited this form, but I am not sure how to add the event to this
child class when its button is clicked.

I appreciate any pointers on how to do this.

Thanks,

Alij

 
Reply With Quote
 
 
 
 
Michael Nemtsev [MVP]
Guest
Posts: n/a
 
      20th Nov 2007
Hello Alij,

Not quite understood what are you trying to reach.
You can use base. identificator to have access to your parent class

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


A> have a simple form with two TextBox controls and two Button
A> controls. I have inherited this form, but I am not sure how to add
A> the event to this child class when its button is clicked.
A>


 
Reply With Quote
 
 
 
 
Alij
Guest
Posts: n/a
 
      20th Nov 2007
Hi,

I figured out the problem. I had a base class and was trying to access a
private TextBox from the derived class. Had to change it to protected and I
could access the TextBox object and change its events -- this is whatI was
trying to ask.

Thank you!
Alij

"Michael Nemtsev [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello Alij,
>
> Not quite understood what are you trying to reach.
> You can use base. identificator to have access to your parent class
>
> ---
> WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
> http://spaces.live.com/laflour
> "The greatest danger for most of us is not that our aim is too high and we
> miss it, but that it is too low and we reach it" (c) Michelangelo
>
> A> have a simple form with two TextBox controls and two Button
> A> controls. I have inherited this form, but I am not sure how to add
> A> the event to this child class when its button is clicked.
> A>
>


 
Reply With Quote
 
Karthik
Guest
Posts: n/a
 
      30th Jan 2008
Dear Alij

Change control's MODIFIERS property to public or protected on Base from.
Build the project once again.
Now you can access the control from the child form.

Regards
Karthik.C
----------------------------------------------------------
Winners do not do different things. They do things differently.

"Alij" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I figured out the problem. I had a base class and was trying to access a
> private TextBox from the derived class. Had to change it to protected and
> I could access the TextBox object and change its events -- this is whatI
> was trying to ask.
>
> Thank you!
> Alij
>
> "Michael Nemtsev [MVP]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello Alij,
>>
>> Not quite understood what are you trying to reach.
>> You can use base. identificator to have access to your parent class
>>
>> ---
>> WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
>> http://spaces.live.com/laflour
>> "The greatest danger for most of us is not that our aim is too high and
>> we miss it, but that it is too low and we reach it" (c) Michelangelo
>>
>> A> have a simple form with two TextBox controls and two Button
>> A> controls. I have inherited this form, but I am not sure how to add
>> A> the event to this child class when its button is clicked.
>> A>
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Inheritance: Specified Cast Is Not Valid? James Microsoft Dot NET Framework 5 20th Sep 2004 09:04 PM
Form Inheritance still a problem in VS 2003? Mike Microsoft Dot NET Framework 4 4th May 2004 02:33 AM
Need help with windows form inheritance Nathon Dalton Microsoft ASP .NET 1 17th Oct 2003 10:29 PM
Form Inheritance and Anchor mike Microsoft Dot NET Framework 0 26th Jul 2003 12:01 AM
visual inheritance of web form varun Microsoft ASP .NET 5 7th Jul 2003 12:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:46 AM.