Changing the border of a TextBox isn't currently supported by the
.NETCF, nor by the TextBoxEx in the SDF on OpenNETCF.
Is there any way to change the border of a TextBox by yourself? I
would like to keep only the bottom line of the box. I know that that
is not a standard BorderStyle, but normally you can adjust the Paint
of a control, which isn't possible in the .NETCF.
Anyone who has found a way to do this?
Thx
Try this code below
using System;
using System.Drawing;
using System.Windows.Forms;
namespace paneltextbox
{
public class PanelTextBox : Panel
{
/// <summary>
/// Class to create a ProgressBarPanel Control
/// </summary>
# region " Destructor "
/// <summary>
/// Clean up resource memory used.
/// </summary>
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#endregion
#region " Globals "
// Global Variables
private Panel PnlWnd;
private TextBox txtBox;
# endregion
# region " Paint Constructor "
/// <summary>
/// Constructor to build control
/// </summary>
public PanelTextBox()
{
//Set Form Rectangle Area
this.Bounds = new Rectangle(63,31,98,21);
//Set Form Background Color
this.BackColor = Color.Black;
//Add New Panel and Set Area
PnlWnd = new Panel();
PnlWnd.Bounds = new Rectangle(0, 0, this.Width, this.Height);
PnlWnd.BackColor = Color.White;
this.Controls.Add(PnlWnd);
//Add StatusBar Label
txtBox = new TextBox();
this.txtBox.Location = new System.Drawing.Point(-1, -1);
txtBox.Text = "";
PnlWnd.Controls.Add(txtBox);
}
# endregion
}
}
Hope this helps,
Cheers,
Arun.
www.innasite.com
That works fantastic. Thanks!
But can you explain to me why, by setting the point to (-1,-1) it
doesn't draw the right line of the textbox?
I thought the x-axis pointed from left to right en the y-axis from top
to bottom, but then you would get the right line drawn if one
specifies the (-1,-1) point...where am I mistaken?
Thx!
NS
On 22 Aug 2005 03:21:48 -0700, "Arun" <arunkuma...@gmail.com>
wrote:
>But can you explain to me why, by setting the point to (-1,-1) it
>doesn't draw the right line of the textbox?
It is just hidden behind the panel. You can try setting it to 0,0 to
see the lines.
Cheers,
Arun.
www.innasite.com