Solved

Chang background color on textbox

Posted on 2002-06-21
6
567 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
[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
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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 52

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

724 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