Solved

Changing text box border color

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 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