how to avoid focus for specific control

eugzl

Member
Local time
Today, 08:56
Joined
Oct 26, 2021
Messages
127
Hi All.
I created continuous form with option for label header to sort it. And replace inside of label two buttons with arrow up and arrow down.
btnLabel.png

In case when I click label to sort form in ASC order upper triangle will hidden. When I click label to sort form in DESC order down triangle hidden and upper will appears. All work fine until mouse don't click one of triangle. In case when I click one of triangle I getting error message:
Run-time error '2165':
You can't hide a control that has the focus.

How to solve the problem to avoid set focus on buttons with arrow up and arrow down in case when click on them?
Thanks.
 
Move the focus away from the control you want to hide before hiding it.
 
Oops!

I deleted my post because I assumed you were filtering not sorting!
 
Move the focus away from the control you want to hide before hiding it.
Hi theDBguy. Thanks for reply.
Good idea. Strange why I didn't guess by myself. I created txtBox with height and width equal 0 and created Click event them in case click on buttons with triangles where I set focus on that txtBox.
Thanks
 
Hi theDBguy. Thanks for reply.
Good idea. Strange why I didn't guess by myself. I created txtBox with height and width equal 0 and created Click event them in case click on buttons with triangles where I set focus on that txtBox.
Thanks
Hi. Glad to hear you got it working. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom