Click here to Skip to main content
15,910,358 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello I could change the BorderColor of the textbox
C#
ControlPaint.DrawBorder(e.Graphics, this.ClientRectangle, borderColor, ButtonBorderStyle.Solid);

but i want all borders (color for top,color for bottom,color for left and right) how do I do that? thank you


I want that: http://imageshack.us/photo/my-images/821/bczo.jpg/

I just know programming basics I do not understand well! if they showed some code would be great to start

someone with experience to help me please?
Posted
Updated 29-Jul-13 6:46am
v3
Comments
[no name] 28-Jul-13 12:52pm    
You would need to create your own textbox and handle the drawing yourself.

Here's a solution, you just have a problem the font setting loses I think
C#
int borderWidth = 1;
ControlPaint.DrawBorder(e.Graphics,
                      e.ClipRectangle,         Color.Green, borderWidth, 
                      ButtonBorderStyle.Solid, Color.Red, borderWidth,
                      ButtonBorderStyle.Solid, Color.Blue, borderWidth,
                      ButtonBorderStyle.Solid, Color.Yellow, borderWidth, 
                      ButtonBorderStyle.Solid); 
base.OnPaint(e);
 
Share this answer
 
If you know making custom controls. You can do that extending the text-box. Else search this site for making custom controls.
 
Share this answer
 
Comments
po1725 28-Jul-13 13:38pm    
I'm learning not know very well

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900