Solved

Changing text box border color

Posted on 2007-03-18
4
358 Views
Last Modified: 2013-12-26
How do I change the border color of a text box in VB6 ?
0
Comment
Question by:villartech
4 Comments
 
LVL 4

Accepted Solution

by:
cx323 earned 125 total points
ID: 18744922
you can't by default, you can create your own or use someone elses, or you can set the borders style to none and then put a rectangle shape around the textbox in an attempt to fake a border
0
 

Expert Comment

by:enable99
ID: 18985305
Extending the TextBox won't work.  The OnPaint and OnPaintBackground methods of the TextBox control are not called and therefore you cannot modify their painting behavior.

About the best you can do would be to create a usercontrol that contains a TextBox set just inside it's border and then change the backcolor of the usercontrol to the desired "border" color.  This would give the effect of there being a border around the TextBox.  The same could be achieved by just dropping a textbox into a colored frame and sizing things correctly.

I know its a kludge but in all the posts about changing a textbox's appearance that I've seen, I've never come across a way to truely change the drawing behavior of a textbox.

I suppose another option would be to create a UserControl that recreates the functionality of a TextBox without actually inheriting from one...

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now