how to intercet ondraw event?
-
I want to intercet the ondraw event of textbox to avoid to draw the classic base with a trasparent one. How could i do?
Off the top of my head, if you derive your own class from a TextBox component, you could override the OnPaint method and not call base.OnPaint. Haven't done it before though, so it may be wrong, but I believe that is what you are looking for.
-
Off the top of my head, if you derive your own class from a TextBox component, you could override the OnPaint method and not call base.OnPaint. Haven't done it before though, so it may be wrong, but I believe that is what you are looking for.
Yes, deriving a class from TextBox will let you handle the OnPaint and OnPaintBackground events yourself. However, creating a transparant textbox is a much more difficult endeavor than that. Two articles that offer solutions to this are: http://www.codeproject.com/cs/miscctrl/alphablendtextbox.asp[^] and http://www.codeproject.com/cs/miscctrl/TransparentTextBox.asp[^]