Solved

Chang background color on textbox

Posted on 2002-06-21
6
562 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
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.

 
LVL 49

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

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

Suggested Solutions

Title # Comments Views Activity
Visual Basic Excel Formatting error 4 83
Saving history changes to sub form 4 36
Visual Studio 2005 text editor 10 35
VB6 ListBox Question 4 34
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

867 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

22 Experts available now in Live!

Get 1:1 Help Now