?
Solved

How to remove focus from the combo box?

Posted on 2006-07-21
6
Medium Priority
?
2,820 Views
Last Modified: 2007-12-19
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
Comment
Question by:pmud
[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
6 Comments
 
LVL 17

Expert Comment

by:CSecurity
ID: 17155648
Try this:

Private Sub Combo1_Click()
Label1.SetFocus
End Sub
0
 
LVL 17

Accepted Solution

by:
CSecurity earned 2000 total points
ID: 17155655
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
 
LVL 13

Expert Comment

by:jmundsack
ID: 17155668
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
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!

 
LVL 9

Expert Comment

by:Rob_Jeffrey
ID: 17156509
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
 

Author Comment

by:pmud
ID: 17157400
Hi CSecurity,

That works perfectly. :)

Thanks
0
 
LVL 17

Expert Comment

by:CSecurity
ID: 17161298
You're welcome... I was used that trick before :p :D
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses

719 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