|
-
Jul 23rd, 2004, 01:37 PM
#1
Thread Starter
Addicted Member
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)
Using Visual Studio .NET 2005
-
Jul 23rd, 2004, 03:06 PM
#2
Addicted Member
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);
-
Jul 24th, 2004, 04:44 AM
#3
Thread Starter
Addicted Member
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);
Using Visual Studio .NET 2005
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|