Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Changing text box border color

Posted on 2007-03-18
4
Medium Priority
?
380 Views
Last Modified: 2013-12-26
How do I change the border color of a text box in VB6 ?
0
Comment
Question by:villartech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Accepted Solution

by:
cx323 earned 500 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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.
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…
Suggested Courses

636 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