473,657 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 19852
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(ByV al 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.L ocation, 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
14490
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 extent, the "stylish buttons" tutorial here: http://www.webreference.com/programming/css_stylish/ and have had mostly success with it, however one stupid thing isn't
31
7201
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
6210
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 to do differently for ie The html tag: <td class="pup_pic" id="lit1_pic1"><a onmouseover="StatMessage (2);" onmouseout="StatMessage (1);" onclick="OpenHiRes ('male-1.jpg','Male-1','test');" ><img src="graphics/litters/test/male-1.jpg" alt="Male-1...
1
22496
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 to change the color to something a little more appealing. I've tried overriding OnPaint, like this: public partial class MyControl : UserControl { public MyControl()
1
6764
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. thanks <html> <head> <style type="text/css">
2
4763
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 Properties Please Help me Thanks & Regards Mahesh
3
17520
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 background/foreground colors etc and the border also have some propereties, but not the color and shading... Claes
0
1394
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 didn't do that in visual basic....): Gr Paul
2
3600
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 of the <td> which i do but the row in between the colommns have a blue color. <tr class="tbDetailNew"> <td width="8%">*</td> <td colspan="6"> <table id="test" style="border:none; backgound-color:blue;" width='100%'>
0
8420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8516
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.