Solved

Combo.Text goes blank

Posted on 2002-03-15
8
180 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
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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 

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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

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

822 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