• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3532
  • Last Modified:

How to remove focus from the combo box?

Hi,

I have a vb 6 activeX project. When the execution of my program finishes, the cursor is automatically placed in the combo box . The combo box and a frame are the only controls that are visible during this time. Is it possible to remove focus from the combo box when execution finishes? the reason I need to do is that when users scroll down after execution, they are actually scrolling through the driopdown and not the page.  The frame has some labels embedded in it. I tried setting focus on the frame or label, but it doesnt have setfocus property. Basically, I want to remove focus from the conmbo box .

Thanks for any help.
0
pmud
Asked:
pmud
1 Solution
 
CSecurityCommented:
Try this:

Private Sub Combo1_Click()
Label1.SetFocus
End Sub
0
 
CSecurityCommented:
For sure Label object doesn't have SetFocus. Then you should try another object.

You can add 1 Textbox. So little (height and width can be a number like 120)
Then set the top = -1000

To be not visible but it should exist in form (visible = false would not work)

Then set focus on that object...;) [This is just a trick]
0
 
jmundsackCommented:
What do you mean "and not the page"?  What are they scrolling through when they're scrolling through the "page"?  Is it a web page?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Rob_JeffreyIT/ProgrammingCommented:
When your code is finshed executing - would it work to set the combobox.enabled=false?
You  may wish to do that to all visible controls - to stop confusion.  You may want to add another button that re-enables the control if further interaction is required.  On startup make it cmdButton.visible=false and set it visible when disabling the combobox.

I don't know if this is a good idea - I havn't seen your project.
0
 
pmudAuthor Commented:
Hi CSecurity,

That works perfectly. :)

Thanks
0
 
CSecurityCommented:
You're welcome... I was used that trick before :p :D
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now