?
Solved

Chang background color on textbox

Posted on 2002-06-21
6
Medium Priority
?
570 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
Technology Partners: 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!

 
LVL 53

Accepted Solution

by:
Ryan Chong earned 1000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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 …
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 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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 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