G
Guest
hi,
i read in the web about how can i change the foreColor of a textBox when
it's set to enabled=false or readonly, and that what was written:
public MyTextBox()
{ // This call is required by the Windows.Forms Form Designer.
this.SetStyle(ControlStyles.UserPaint,true);
}
protected override void OnPaint(PaintEventArgs e)
{
SolidBrush drawBrush = new SolidBrush(Color.Blue); //Use the ForeColor
property
// Draw string to screen.
int sizes=this.Size.Width;
e.Graphics.DrawString(Text, new System.Drawing.Font("Microsoft Sans Serif",
8.5f, System.Drawing.FontStyle.Bold), drawBrush,0f,0f); //Use the Font
property
}
now my problem is that sometimes i need the text to be wrriten from right To
left and sometimes from left to write, i tried to change the alligment and
the rightToleft property but still the point(0,0) stays always from the left
side.
and my textbox sizes are different so i can i make it to write my text form
the right point of the text box to the left?
thanks
i read in the web about how can i change the foreColor of a textBox when
it's set to enabled=false or readonly, and that what was written:
public MyTextBox()
{ // This call is required by the Windows.Forms Form Designer.
this.SetStyle(ControlStyles.UserPaint,true);
}
protected override void OnPaint(PaintEventArgs e)
{
SolidBrush drawBrush = new SolidBrush(Color.Blue); //Use the ForeColor
property
// Draw string to screen.
int sizes=this.Size.Width;
e.Graphics.DrawString(Text, new System.Drawing.Font("Microsoft Sans Serif",
8.5f, System.Drawing.FontStyle.Bold), drawBrush,0f,0f); //Use the Font
property
}
now my problem is that sometimes i need the text to be wrriten from right To
left and sometimes from left to write, i tried to change the alligment and
the rightToleft property but still the point(0,0) stays always from the left
side.
and my textbox sizes are different so i can i make it to write my text form
the right point of the text box to the left?
thanks