-
Textbox border
I've just started with C# having used C++ and VB in the past. I'm finding it quite nice to use, but one small niggle is that (like VB) you can't specify the border colours for many of the controls (specifically the TextBox).
Is there a way around this? With VB I used to just create a borderless textbox and then use a 'Shape' control to do the border manually. Is there a better way to do this in C#?
(I'm using Visual C# if that makes any difference)
-
You can do it the same way just use this
Code:
Graphics g = e.Graphics;
Pen p = new Pen(Color.Black, 2.0f);
g.DrawLine(p, this.Width/2, 2, this.Width/2, this.Height/2,lblCenter.Height/2);
-
Thanks! I had to change the code to the following, but thanks for pushing me in the right direction!
Code:
Graphics g = e.Graphics;
Pen p = new Pen(Color.Blue, 2.0f);
g.DrawRectangle (p, 0, 0, cmdTest.Width, cmdTest.Height);