473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
Nov 20 '05 #1
2 19796
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
////
Nov 20 '05 #2
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Sheila King | last post by:
Hello, Am at my wits end, after spending quite a bit of time looking at online CSS docs, reading FAQs, searching this newsgroup and validating my CSS document. Was trying to copy, to some...
31
by: jcrouse | last post by:
Is there a quick and easy way to change the color of a label controls border from the default black to white? Thank you, John
3
by: joecapau | last post by:
Could use some help here - first time building a website..I want the script to change the border color - it works in firefox, but not ie (i tried ie 6 and 7) - I can't figure out what i am supposed...
1
by: David Veeneman | last post by:
Is there a simple way to change a UserControl border color? I'm creating a UserControl that will have a border, using the UserControl.BorderStyle property. The standard border is black; I'd like...
1
by: sueian | last post by:
can some1 help with this code. can i add in a function like on click. when user click one of the link. the color will change to static from mouse over color. the text need to highligted after click....
2
by: Mahesh83 | last post by:
Hi I am using Microsoft VB 2005 Express Edition I want to Change the Border Color of the textbox that to flat TextBox... I guess i am missing something to install as that option is not in my...
3
by: =?Utf-8?B?Q2xhZXNXZWRpbg==?= | last post by:
I want my application to have a special color on the Window forms borders. Not the standard one (which the user has set up in his desktop-properties)... How can I do this? I can change...
0
by: djpaul | last post by:
Hello, Does anyone know how to change the color of the form border? I want it to turn black and maybe change the close/maximize and minimize buttuns by an graphics button. To bad microsoft...
2
by: ismailc | last post by:
Hi, need help please! I have a table within a table, the background color of table is blue to match the background color of my <td>. but now i want onmouseover to change the background color...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.