Solved

Combo.Text goes blank

Posted on 2002-03-15
8
178 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
  • 4
  • 4
8 Comments
 
LVL 15

Expert Comment

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

Author Comment

by:hlominac
Comment Utility
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
Comment Utility
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
 

Author Comment

by:hlominac
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 15

Accepted Solution

by:
ameba earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

772 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

15 Experts available now in Live!

Get 1:1 Help Now