How to change the border color of a Textbox in VB.NET?

  • Thread starter Thread starter Ramesh
  • Start date Start date
R

Ramesh

Hi,
Is there any solution available for changing the border
color of the textbox control in VB.NET? Pls provide me
with a sample code.
Thanks in advance
Ramesh
 
Hi Ramesh,

I could found this in the newsgroup

I hope this helps a little bit?

Cor

\\\Taken from newsgroup with Jacob Grass a little bit changed for VS2003
Private Sub form1_Paint(ByVal sender As Object, _
ByVal e As PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim pen As New Pen(Color.Red, 2.0)
For Each ctr As Control In Me.Controls
If TypeOf ctr Is TextBox Then
g.DrawRectangle(pen, New _
Rectangle(ctr.Location, ctr.Size))
End If
Next
pen.Dispose()
End Sub
////
 
Hi Cor,
That's a nice bit of code. Yup I created a user control and applied the
same code in the user control's paint event, it works fine. Does it
affect the loading performance of the screen. Is there any sample code
for making a combo box as a flat type with colored border

Thanks in advance
Ramesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top