Solved

Combo.Text goes blank

Posted on 2002-03-15
8
183 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
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!

 

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 100 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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

726 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