Click to See Complete Forum and Search --> : Enhancing The Textbox


peteinman
September 6th, 2002, 09:11 AM
I would like to write a set of classes for handling different types of textboxes.

My base class ( myTextBoxBase ) would need have a method to set the tooltip, so I will have a user control containing a textbox and a tooltip control.

I would then like to derive another class from myTextBoxBase which would allow me to handle the right click mouse button. It would still have the ability to handle tooltips, as it inherited from myTextBoxBase.

It all sounds reasonable, but I cannot get it to work.

As a test I simplified my functionality, and created myTextBoxBase with the tooltip functionality. All works fine.

I then derived another textbox form myTextBoxBase, and all this would do is be a textbox with a Red background.

It has tooltip functionality but doesn't have a Red background.

When I tried to get the right mouse button handling, again it had the tooltip functionality but not the right mouse button.

All I want to end up with in my test is

Am I doing anything obviously wrong ? Do I need to call base constructors?

Anyone any idea what I'm missing?

Pete

CPCericola
September 12th, 2002, 02:48 PM
This may not apply, but I remember I had some issues trying to create an extended textbox. The issue that I ran into is that the text box isn't handled by the CLR and instead controlle entirely by Windows. You may also want to investigate, if you haven't already, the control sytles enumeration where you can enable "UserPaint".

peteinman
September 12th, 2002, 03:43 PM
Thanks, I actually got very confused, started again with a simple example, and have it all working now.

Thanks again.
Pete:)