[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Combo.Text goes blank

Posted on 2002-03-15
8
Medium Priority
?
189 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
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!

 

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

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!

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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

656 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