focus

How can I make a specific TabItem gain focus on a TabControl without click event?

How can I tell my TabControl to set the focus to its first TabItem, something like this: PSEUDO-CODE: ((TabItem)(MainTabControl.Children[0])).SetFocus(); ...

How to automatically save files on lose focus in Emacs.

Is it possible to configure Emacs, so that it saves all files when the emacs window loses focus? ...

Setting the focus to the next input in jQuery?

Hi guys, I've currently got a script that'll check for the value of a select box, and then enable a text field right next to it, and then hopefully set focus. I have this at the moment which works fine at enabling the input field... $("#assessed select").change(function () { if($(this).val() == 'null') { $(this).next('input').attr("...

ContextMenu.StaysOpen Property (WPF)

Simple question here: what does the StaysOpen property of the ContextMenu (or equivalently Popup) control actually do? I have tried observing the difference in behaviour, but I notice none whatsoever. MSDN states the following: true if the menu should stay open until the IsOpen property changes to false; otherwise, false. The defau...

Why are textboxes in my page getting focus on pageload?

I have a page with textboxes and buttons. When the page loads, often times, focus is in one of the textboxes and I don't want this to happen. However, I don't want to use something like setfocus in the page load event because then when buttons are clicked the page will jump. How do prevent the textboxes or any controls for that matter of...

How to create focused ImageButton in Windows Mobile application?

I have Windows Mobile 6.0 application. I have ImageButton control given by Microsoft. I want my ImageButton control to have focus border like any standard button. How I can do it? Thanks in advice! ...

Standard way to detect when focus leaves an element

How can I, in a standard way, detect when focus leaves an element or any of its child elements. blur won't do since it's fired when the focus goes into a child element. IE provides the incredibly useful event focusout for this (it's like blur, but bubbles), but How can I do it in a standard way, except for attaching a blur handler to a...

How do I color LabelField text within a ListField when the parent manager has the focus?

I have an overridden LabelField that allows me to change the font color based on whether an item in my ListField should be subdued or now. Making the LabelField color subdued works great. But, when the row (that contains my LabelField) is highlighted in the ListField, I would like the label field color to be different or inverted. Her...

Selecting text on focus using jQuery not working in Safari and Chrome

I have the following jQuery code (similar to this question) that works in Firefox and IE, but fails (no errors, just doesn't work) in Chrome and Safari. Any ideas for a workaround? $("#souper_fancy").focus(function() { $(this).select() }); ...

IE8/Firefox Behavioral Difference

I'm working on login page written as a JSP. It's pretty simple but behaves differently in IE8 and Firefox (big surprise there). I have not tested this is other browsers yet. I could probably hack a fix in with some Javascript but I was looking for more information about the behavior, before I just implement a workaround, with hopes of a...

WPF Focus Navigation Wrapping

Is there a way to force Focus Navigation (as controlled by the Tab key or MoveFocus method) to wrap inside a given container? I have included code which demonstrates this problem below. What is the easiest way to make Tab move focus from TextBox "Charlie" to TextBox "Able" (and visa-versa for Shift+Tab on TextBox "Able") rather than mo...

Can I handle an ALT+TAB key press within my web page?

I realize this is a program switcher key combo in most OSs. Is there a possibility of capturing such an event in the web page via JavaScript? ...

Using multiple SWF Object - Flash doesn't focus on rollover

I've got a page with multiple embeds of Flash objects, including dynamically created graphs. I'm including them all with SWF Object JS declared in the header. It works fine in the fact that all are loaded. But, for some reason when you move down on the page (so they're out of view) and back, or click on another object it no longer has f...

how to create a window focus hook

I have the page with iframe (having java applet), now I want to monitor where the focus is from the parent page. Is it possible to check whether Java applet was closed (inside iframe) by monitoring which frame/page has the keyboard focus? ...

How to ensure that the top level WPF "Window" element handles TextInput RoutedEvents?

I've got an application that traps text entry at the window level (i'm using a barcode scanner) and occasionally the operator will click on view elements which then gain focus, taking focus off the window, and the window no longer recieves either previewtextentry or textentry events, any ideas? ...

How to disable navigation on WinForm with arrows in C#?

Hello, I need to disable changing focus with arrows on form. Is there an easy way how to do it? Thank you ...

is it possible to change tab/focus order in an html table so that it transfers vertically first and then horizontally?

is it possible to change tab/focus order in an html table so that it transfers vertically first and then horizontally? ...

WPF: LostFocus event on a particular control/view/viewmodel

I'm working in WPF using the MVVM pattern, and generally things seem to be working pretty well, as I wrap my brain around the nuances of both WPF and MVVM. However, I'm currently stuck on a particular issue. My actual application is fairly complex, so to simplify, let's take Josh Smith's near-defining article on the pattern and use the...

How to give an Exceed X-window focus in a C# application?

Currently our software is running on AIX Unix machines, but we use Windows boxes running Exceed to display the UI in X-windows. I'm writing a Windows application ( modernizing the UI in C# ), but some of the legacy windows still need to be displayed in Exceed. When a user clicks a button on my windows application, it sends a message to...

jquery focus on input

I got one main search field always visible at the site and a login form (by default hidden) only visible if the login button is pushed (this trigger a jQuery toggle function). I have no problem getting the main search field to have focus, but I want the first element in the login form to have focus if visible. In the HTML code, the th...