Solved

Changing text box border color

Posted on 2007-03-18
4
360 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

863 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

24 Experts available now in Live!

Get 1:1 Help Now