gpnet 0 Newbie Poster

Hi to all,
Recently I was trying to create a custom textbox inheriting from user control because I have special functions to implement and the textbox control , as you know , has problems whit borders and fixed font height.

So I create the control basically this way:

public partial class myNote : UserControl
{
        private int iCursor;

         public myNote ()
        {
            InitializeComponent();
            iCursor = 0;
        }
        protected override void OnPaint(PaintEventArgs e)
        {
	   SolidBrush brushText;
	    Pen tPen ;
            Graphics g;
            
            base.OnPaint(e);
            g = e.Graphics;
            
        	brushText = new SolidBrush(ForeColor);
    		g.DrawString(FInternalText, Font, brushText, 2, 2);
    		
    		SIZE size = GetStringSize(FInternalText.Substring( 0, iCursor ), 0, Font );
    		xCaret    = size.cx;
    		caret.Position 		= new Point( xOffset +size.cx , 2);
    		caret.Show();
    		
        	
        } 
    	protected override void OnKeyPress( KeyPressEventArgs ea )
    	{
           FInternalText = FInternalText.Substring( 0,iCursor ) + ea.KeyChar + FInternalText.Substring(iCursor);
           Invalidate();
        }
}

The strange thing is when I write special chars like / (slash) or \ (backslash) . In these cases the text rendering get to be narrow one char close to the other, without the correct interspace.
On the contrary the pixel's length calculating invoking GetTextExtentPoint32 is correct and the cursor gets the right X position.

I attached i bitmap to see how string is rendering.

I suspect the user control or the drawstring function interpret these chars like escape sequence , but I don't know how to prevent it.

Some one could help me ?