?
Solved

Combo.Text goes blank

Posted on 2002-03-15
8
Medium Priority
?
186 Views
Last Modified: 2010-05-02
During a debugging session I set the text in a combo text box (Combo1.Text = "Search").  I can switch over to the screen and see that Search is entered.  But when I exit the subroutine and return to the main screen, the text field is blank. Later after further processing, the data is in the combo text box again.  What can I do to fix this "bug"?
Harold
0
Comment
Question by:hlominac
[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
  • 4
8 Comments
 
LVL 15

Expert Comment

by:ameba
ID: 6869490
Set ClipControls=False for: container of your combo, and for container of that container.
0
 

Author Comment

by:hlominac
ID: 6870071
That didn't work.  Perhaps I am missing something.  The combo is in my frmMain.  It's name is cbMinor.  frmMain has a property ClipControls which I set to false.  CbMinor does not have a property ClipControls.  Any other suggestions? TIA Harold
0
 
LVL 15

Expert Comment

by:ameba
ID: 6870144
VB has problems repainting controls, especially if controls are nested.  My first comment solves most such problems.

Repainting is low priority task, and in IDE it doesn't work perfectly - that is OK for me.  It is much better than not having the ability to "Run and Continue".
0
Industry Leaders: 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!

 

Author Comment

by:hlominac
ID: 6870753
You said "in IDE it doesn't work perfectly."  I compiled the program and executed it with the same problem.  Is this a bug in VB6 Professional?  Would another version of VB work?
0
 
LVL 15

Accepted Solution

by:
ameba earned 300 total points
ID: 6870776
I don't think VB versions are that different.

Maybe you are using LockWindowUpdate, or sending ValidateRect or some similar message using API?

If all fails, try inserting Combo.Refresh at the end of your subroutine.
0
 

Author Comment

by:hlominac
ID: 6870928
I tried Combo.Refresh first thing which did not help.  I use Register API's to use the registry, but nothing else.  I have 3 combo boxes in the same form.  One works but two don't.  Earlier the first one did not work, but somehow it now works.  The code is nearly identical.  It must be in the compiler, would you agree?
0
 

Author Comment

by:hlominac
ID: 6871019
Working on the assumption there was a compiler error, I tried different approaches.  I had been using combo.clear then rebuilding the list.  When I decided not to clear the list, and worked around that, the problem cleared up.
Thanks for our information.  Harold
0
 
LVL 15

Expert Comment

by:ameba
ID: 6871975
Next time, if you solve your question yourself, you don't have to award the points.
B really is not 'thank you', but insult.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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
Course of the Month12 days, 1 hour 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