-
Jan 26th, 2013, 04:12 AM
#1
Thread Starter
Member
Disabling Button Focus
So, I'm running into an issue, which I believe has to do with button focus.
Lets say you have a search bar in your program where the user could search for files.
You set AcceptButton to the associated button for enabling the search field.
In my program, once the enter button is pressed and the search is performed, that search button remains highlighted.
I have several search fields like this, all of which I've set the AcceptButton on - for ease of use.
Honestly, I just think its visually annoying to have these random buttons highlighted after being pressed.
I've tried setting the focus to other objects (adding that code below the various search button codes).
Unfortunately, that didnt work as I had hoped - it disabled the user for being able to type anything into the search fields.
Any help would be greatly appreciated.
Thank you for your time!
-
Jan 26th, 2013, 07:55 AM
#2
Re: Disabling Button Focus
Have you tried setting focus to another control via ActiveControl = SomeControl ?
-
Jan 26th, 2013, 09:49 AM
#3
Thread Starter
Member
Re: Disabling Button Focus
Kevin - I appreciate your input - unfortunately, that didnt work.
Ideally, once a search button is pressed, I'd like to focus on the window that displays all of the search results.
I've tried:
Code:
ActiveControl = SearchWindow
So will this only work if I select another control for the focus - ie, one of the other buttons?
-
Jan 26th, 2013, 10:26 AM
#4
Re: Disabling Button Focus
Guess I misunderstood you, I was thinking you wanted to set focus to a control and not a window.
-
Jan 26th, 2013, 10:31 AM
#5
Re: Disabling Button Focus
Originally Posted by kevininstructor
Guess I misunderstood you, I was thinking you wanted to set focus to a control and not a window.
Are these 'windows' forms? If so just bring the search form to the front and select the appropriate control.
Last edited by dbasnett; Jan 26th, 2013 at 10:47 AM.
-
Jan 26th, 2013, 10:37 AM
#6
Re: Disabling Button Focus
Well if you are using default controls and no custom code for highlighting then it should be as simple as
Control.Focus
That said you have not given us much to go on, we don;t even know what kind of app you are talking about here
-
Jan 26th, 2013, 10:46 AM
#7
Re: Disabling Button Focus
There is a note here http://msdn.microsoft.com/en-us/libr...vs.100%29.aspx that says, "Focus is a low-level method intended primarily for custom control authors. Instead, application programmers should use the Select method or the ActiveControl property for child controls, or the Activate method for forms."
-
Jan 26th, 2013, 11:15 AM
#8
Re: Disabling Button Focus
hmm I had not saw that, I do mostly mobile apps in Vb.Net and have been using the .Focus method for years under VB 2003, 2005 and 2008 never had any issues with it.
-
Jan 26th, 2013, 11:26 AM
#9
Re: Disabling Button Focus
Originally Posted by DataMiser
hmm I had not saw that, I do mostly mobile apps in Vb.Net and have been using the .Focus method for years under VB 2003, 2005 and 2008 never had any issues with it.
Maybe a CYMSA.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|