focus

MVVM Focus To Textbox

How would I set focus to a textbox without specifying the name for that textbox? At the moment I am doing the following <Window FocusManager.FocusedElement="{Binding ElementName=Username}"> <Grid> <TextBox Text="{Binding Username}" Name="Username" /> </Grid> </Window> Is there any way of doing this without ...

How to prevent my C# winforms application from stealing focus when I set the visible properly to true?

I've got a C# winforms application that runs in the background, listening for hotkeys to be pressed. When a hotkey is pressed, my form makes a brief appearance. The form is always running, but set to hidden until I receive a hotkey event, at which time I set the visible property to true. The code looks like this: void hook_volumeDown...

Jquery question : maintain focus upon appending a row?

The function below checks whether the id entered is already in the database, and if it is, then it adds some html to the table. I'm not sure if it's directly related to my issue or not, but, essentially, a user will place the focus on the id input field and enters an id. Using ajax, it posts to a php script and returns data if rows are...

Textbox1.Focus(); does not work; as does not Page.SetFocus(Textbox1); why?

as stated both of these do not work (from Page_Load): Textbox1.Focus(); or Page.SetFocus(Textbox1); any idea why? this is the control itself: <asp:TextBox ID="Textbox1" ClientIDMode="Static" CssClass="Textbox1" runat="server" MaxLength="80"></asp:TextBox> it is located on a page, two master pages deep. the form ...

WPF HwndHost keyboard focus

The chart area in the screenshot is a HwndHost control which hosts a native Win32 window (with it's own registered WNDCLASS) implemented in C++/CLI and drawn with Direct2D. The HwndHost is hosted in a WPF Border control. The problem I have is that I can't set the keyboard focus to the hosted Win32 window. I want the focus to move to the...

jquery set focus on dynamic content?

In jquery I've appended a <li> element to an unordered list. How do I focus on the newly created <li> ? If I do the following: $("ul").append('<li><input type="text" value="Hi!"></li>'); $("li:last").focus(); //doesn't work because new <li> isn't in dom yet the focus doesn't work, as noted above. I know jquery 1.4.2 has a live() ev...

Resize event does not fire in Firefox, but I need to handle focus when FancyBox is shown

I am working on a solution where I need to have the first input field selected when a fancybox is shown. I have tried reacting to the resize event, which works fine in IE but not in Firefox. Also tried reacting to the click event on the link that opens the box - but aparently this is too early so some other element steals focus afterward...

setContentView gives an exception

In my android app I set this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN ); Then my touch screen event doesnt’ work any more. Further Explaining, I have a button and onClick it changes the contentView by setContentView(R.layout.choose_play...

jquery Setting cursor position in contenteditable div

The old version of the question is below, after researching more, I decided to rephrase the question. The problem as before is, I need to focus a contenteditable div without highlighting the text, doing straight up focus highlights the text in Chrome. I realize that people solved this problems in textareas by resetting the caret positio...

Filter next focus components

I want to filter the next focus componenet using the tab key for example , i dont want to focus JLabel, JScrollPane, JScrollBar button, JPanel, etc... How can i do that dynamically without the programmer to handle the focus? Here is what i did : JFrame frame = new JFrame(""); frame.setFocusTraversalPolicy(new JTPCFocusTraversalPo...

how is the container component

hello all i have an application with two main panel LEFT and RIGHT when a component got focus i want to know how is the container that holds that component (LEFT or RIGHT) the component can be inside some other panel's , but eventually sits inside the LEFT or RIGHT panel is there a more simple way to know who is the container withou...

Textbox OnTextChanged and Button Click Event Not Firing

I have textboxes being generated by a repeater that use OnTextChanged with autopostback enabled so that I can know when when the values change. This all works perfect. The problem starts when I try to click on any buttons on the page. The loss of focus triggers the event for the OnTextChanged; however, the event for my buttons never get...

Java on a Mac: How do I detect when my application receives focus?

I looked through ApplicationListener, and they don't have it in there. On a Mac, it's when that application has the equivalent of focus; its menu is in the top menu bar. Also, if you know this, could you tell me how my application can request to de-focus itself? ...

Know who got the focus in a Lost Focus event

Is it possible to know who got the focus in a lost focus event. Compact Framework does not have a ActiveControl, so I don't know how to tell who got the focus. I used this way of finding the focused control. public System.Windows.Forms.Control FindFocusedControl() { return FindFocusedControl(this); } public static System.Window...

Window focus when editing remote files over FTP on a Mac

I use a combination of ForkLift and Textmate to edit files on a remote server via FTP. it works really well, except for one little quirk: when I hit save on Textmate, Forklift saves the file, and then Forklift takes the focus. So, every time I hit Save on Textmate, I have to wait for Forklift to save, and then hit Cmd + Tab to return to ...

Problem with focus in WPF

I have a WPF application which contains a WindowsFormHost and a DataGrid. Inside the WindowsFormHost there is a Windows Form User Control. The DataGrid selected item is binded to a property in the ViewModel. If the selected item changes while I'm holding down the left button of the mouse over the User Control, I lose the focus. Is ther...

WPF: How to programmatically remove focus from a TextBox

I want to add a simple (at least I thought it was) behaviour to my WPF TextBox. When the user presses Escape I want the TextBox he is editing to have the text it had when the user started editing, AND I want to remove the focus from the TextBox. I don't have any problem setting the text for the value it had in the beginning of the edit...

C# Winforms Textbox - Can I keep the selection when it loses focus?

I would like to have a regular textbox on my form, where the selected text is still highlighted even if you use another control, e.g. push a button. Does anyone know a way to achieve this (without using a RichTextBox which is not suitable for what I am doing). Thanks in Advance ...

VB6 - set focus on a textfield on another form

Hi! I want to set focus on a textfield on one form, from another form. How do I accomplish this in VB6? ...

Highlight row of form when input is focussed

I have the following piece of Mootools 1.11 code (not upgradable as this is within Joomla), which I want to highlight the form row, when an item within it is focussed. However, this doesn't work. I need to know how to access the parent div of the form item. window.addEvent('domready', function() { var list = $$('#ChronoContact_lenso...