I''m trying to subclass TextBoxExt to add certain behaviors. I added a file called MyTextBox.cs to my project in VS.Net 2003 which reads:
[using and namespace stuff]
public class MyTextBox : Syncfusion.Windows.Forms.Tools.TextBoxExt
public const int WM_PAINT = 0xf; //Move constant
protected override void WndProc(ref Message m)
base.WndProc (ref m);
PaintEventArgs pea = new PaintEventArgs(CreateGraphics(), Bounds);
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
Graphics g = e.Graphics;
g.DrawRectangle(Pens.HotPink, 1, 1, 5, 5);
it seems to compile ok, but I was expecting it to automatically show up in the My User Controls section of the toolbox. Am I missing something?
(Also, is this the best way to draw some extra stuff on top of a TextBoxExt?)
ADAdministrator Syncfusion Team May 21, 2004 09:17 AM
To be able to perform drawing on the client area of TextBoxExt, you would have to invoke its SetStyle method using the ControlStyles.UserPaint enum value. But when this is set, the system delegates the entire drawing responsibility to the user, and the user would have take of every detail like the borders, text, cursor etc.
To be able to add your control to the VS.Net''s ToolBox please follow the steps given below :
Right click on the ToolBox >> Add/Remove Items >> Click on Browse button >> Navigate to the exe file of your project >> Select it
Please try this and let me know if you need further assistance.
ADAdministrator Syncfusion Team May 21, 2004 07:36 PM
> To be able to add your control to the VS.Net''''s ToolBox please follow the steps given below
Excellent; that works. Do you know if it will correctly pick up whether I''m doing a debug vs. release build?
ADAdministrator Syncfusion Team May 21, 2004 08:13 PM
Oh. never mind, it seems to just add the code, so it should deal with debug/release ok.