Solved

Chang background color on textbox

Posted on 2002-06-21
6
564 Views
Last Modified: 2006-11-17
Hello!

I would like to know how to by using api i can do a similar command to

text1.backcolor=vbred

the problem is i only know a textbox hwnd and i would like to change its back color.
0
Comment
Question by:BlaZer
6 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7099947
hearing...
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7100118
What exactly do you want to do in yr appln. Could you be more specific. Maybe EE has a better way to do it rather than use an API?

-priya
0
 
LVL 1

Author Comment

by:BlaZer
ID: 7100220
well... i use setwindowlong on alot of controls, and i want them to change color on/off focus. If i write it in their own events there is waaay too much code.

so right now i loop all object through in the windowproc till i find one with matching hwnd, then i call obj.backcolor=vbred

but i would very much prefer not to do that loop and just use api.
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 51

Accepted Solution

by:
Ryan Chong earned 250 total points
ID: 7102896
If you do to use API to set the BackGround Color of Text Boxes you still need to do a loop, isn't it? I think it's not worth of using APIs to change the BackGround color of Text Boxes as:

1. Vb provided built-in Property BackColor which we can set the background color of textbox.

2. As a programmer, try avoid 'fancy'/ not so important things in our project development.

But agree if we research on how can we do that by using APIs..
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7923749
Hi BlaZer,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept ryancys's comment(s) as an answer.

BlaZer, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7968456
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

820 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