focus

Showing WinForms dialog with focus from powershell script.

One of my coworkers just came to me with an interesting problem. He's displaying a WinForms form from a PowerShell script, and while the form opens successfully it does not get focus. Instead the PowerShell command window retains focus until the form is explicitly clicked. The script is being run from the PowerShell command line using ...

WPF Tabindexes not behaving as expected - The force is weak....

Hi All, I have a WPF window / form with various controls. I have set the tabindexes in the desired ordered but am getting strange behavior. When tabbing through the window, the order should be as follows: first text boxes on the left, then the date controls on the right, then my tab control and tab pages and then only the buttons. Bu...

Determine if Form has focus in Visual Studio designer

I'm really not sure how to start on this one. I need to know if the form has focus, which I do using ContainsFocus in code. However, this does not seem to work in the designer. Any suggestion? ...

Jquery focus() doesn't work when tabbing?

Hello, I have setup some basic code that triggers on focus of various input fields: var div = '<div class="formHint">Content</div>'; $j('.textbox').blur(function() { $j(".formHint").remove(); }); $j('.textbox').click(function() { $j(this).focus().before(div); ...

focus is causing problems on 1page website design

I have a 1page website that is driven by jquery scrollTo plugin which, I guess, doesn´t matter in my case. The problem seems to be the 1page design. If I click the tab, the entire design is messing up because the tab jumps to whatever it can find to focus on. That includes places that are outside of the current viewport area.Actually I d...

Make WPF TextBox or other focusable controls transparent to certain key presses (i.e. pass-through, not swallow)

I have a ListBox with a custom data template which contains a CheckBox, a TextBlock and a TextBox. Normally when you select an item in a ListBox, the underlying ListBoxItem is actually what has the focus and as such, it responds to the up and down keys. Additionally, if the CheckBox has focus, since it doesn't do anything with the up a...

IE hover/focus/active anchor and span, no javascript

Hi there, currently trying to create the best anchor with background image, hover and active stages. Here is what i have for this moment. It works fine in all browsers except in IE if I press on span (15px left side works fine as it is anchor). Here is example link text . Any ideas? I want to keep current code, no absolutes, no javascri...

Focus and zoom in on a UITextField when touched?

Hello - How in the world does one get the iPhone view to zoom in on a focused UITextField? I need to tap on a text field that I want to edit, and my view should zoom in to the tapped text field and pull up the keyboard (which it already does), similar to how many Internet text fields gain focus on the iPhone. Is this some type of overla...

c# Control.Validating event leaves mouse focus on other controls?

I have a c# .net 2.0 winForm with a textbox and a trackbar. The textbox Validating event sets e.cancel if the user clicks the trackbar and the validation fails. I am then left with the cursor in the textbox, but the mouse focus is still on the trackbar so moving the mouse moves the trackbar. I have tried SetFocus in the validating event...

How can i forbid tab switching the focus into a NSView control

I have a sidebar NSOutlineView in my main window. I want the user to be able to switch the focus with the tab key through all views in the main window, but he should not be able to give the NSOutlineView the focus with a tab key. I know that with - (BOOL)canBecomeKeyView { return NO; } - (BOOL)acceptsFirstResponder { return NO; } i ...

IE8 not allowing jQuery to give focus to textbox

I have jQuery which produces a popup window, as outlined here: http://www.jsfiddle.net/sLjfx/4/ The problem is that the following line: $('#txtValuation').focus(); doesn't seem to want to work in IE8. The popup will load, but the textbox doesn't have focus, where in Chrome the box does have focus.. Is there any work-around for it? ...

WPF TabControl On SelectionChanged, set focus to a text field

I have a tab control, and a few tab items. I am successfully listening to the SelectionChanged event, and checking if the tab I'm interested in is the currently selected one. I'm using this code (below), and stepping through the debugger, I can see that my branching logic works as designed; however, the issue I'm having is that somethin...

C#: System.Windows.Forms.ListBox not grabbing focus.

I'm popping up a ListBox over a TextBox. I set ListBox.Parent to be the DataGrdiView that houses the TextBox (which is the edit control for a DataGridViewCell). I add string items to ListBox.Items, then I set ListBox.Location, ListBox.Width, ListBox.Height, and ListBox.Visible (to true). All of that works fine. But I can't set focus ...

Focusing WPF TreeViewItem when selection changes in another control

Hi All, In my WPF application I have a treeview which is loaded with certain collection. At the top of this tree view control i have a listbox which stores the same items as in the tree view whenever the tree view items are made favorites. I am trying to focus the treeview item whenever there is a selection made in the listbox. Though t...

WPF Checkbox style making focus border behave strangly

Hi All, I am using WPF with a style sheet. In my style I have been trying to customized the look of the dotted focus border for a checkbox. I need the focus border to only draw around the square an not the entire control. I set my style width to 15 and the dotted border is correct, but does not surround the square, its off to the side....

FocusManager.FocusedElement working sometimes on same window

I'm trying to give focus to a DevExpress GridControl on display of the window, so that when the window displays, the user is just able to press arrow keys to navigate the list. I'm using FocusManager.FocusedElement to focus on the GridControls TableView when the page loads, and sometimes it works, but othertimes, I found the usercontrol ...

WPF Focus Tab Control Item on load

Hi, I have a tab control with several tabItems. I have used the FocusManager.FocusedElement="{Binding ElementName=CustomerTab}" to select my tab, but the tab is not showing the dotted border it normally does when using the tab keys. How can I set this? If I use my arrow keys, the focus does move over to the 2nd tab item. Thanks ...

Get the focused element in NETCF WebBrowser contol

Wondering if anyone knows of a way to get the element which currently has input focus within the DOM of the page currently loaded in a .NET CF WebBrowser control. I want to use a control from OUTside the WebBrowser to insert some data into the currently focused control in the DOM. ...

WPF Tableview swallows focus

Hi All, I have a DXGrid that contains a TableView. My Issue is that once I tab into the table view (SNOOP is showing it it focused), I never can exit out of the table view control. There are other controls after the tableview. All tabindexs are correctly set. Thanks ...

Chrome resets the textarea scroll bar (scrollTop) when focus is called

Chrome (7.0.517.41 beta) (sometimes?) resets a textarea's scroll bar (scrollTop) when you call focus. Does anyone know if this behavior is deliberate, a known bug, or neither? It seems quite unintuitive; Firefox keeps it the same. A simple example is below: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHT...