focus

Java - How to set focus the already running application ?

I am using a ServerSocket port to run one instance only of my Java Swing application, so if a user tries to open another instance of the program, i show him a warning that "Another instance is already open". This works fine, but instead of showing this message i want to set focus on the running application itself, like some programs does...

ASP page get current focused control

So what I have is a bunch of dynamically created textboxs that when the user enters some data and either tabs out or clicks out some calculations are done. After the page posts back control focus is lost. What I need is to be able to set focus back to the control that was tabbed to or clicked into not the control that data was entered in...

How do i set focus to a text box Html.TextBoxFor - mvc 2

Hi, I'm trying to set focus on a text box which generated in the following way: <%=Html.TextBoxFor(model => model.Email, new { style = "width:190px;Border:0px", maxsize = 190 })%> i tried to use javascript which didnt help much. var txtBox = document.getElementById("Email"); if (txtBox != null) txtBox.focus(); ...

Changing the window title when focussing the window doesn't work in Chrome

I'm (ab)using the document title as some kind of a notification area. If the tab/window in question doesn't have focus at the time I want to notify the user of something, I change the window title to include some notification. When the window/tab comes back into focus, I want to remove the notification, i.e. reset the title to standard....

SWT: Proper handling of Lost/Gained Focus in Custom Controls

Hello Experts Our Control I have a Custom SWT implementation of a Combobox/DropDownList. This is implemented as a Composite containing a Text and a Button. When the list is showed, we use a List control that is placed on top of everything and positioned at the Text and Button. This works as expected. The Problem But we are having issu...

Commit Focused Element in Silverlight

I need code that will force Silverlight to commit the focused element (in my case a TextBox, but it could be anything). In WPF I use public static void CommitFocusedElement() { UIElement element = Keyboard.FocusedElement as UIElement; if (element != null) { TraversalRequest request = new TraversalReq...

Is there a way find out which second event will happen in MFC

Hello, I stumbled upon a curious problem with MFC. I have a Dialog where I check every Edit field on ON_EN_KILLFOCUS if it's valid. If validation doesn't go through I set focus back and show error message. This would be fine, if only I would close the dialog. I mean if I leave wrongly entered field and press close button or X, then ON_E...

Android - How to tell is someone has pressed a SPINNER but not changed the visible item in it.

I have a spinner, which mostly works. If a user selects one of the items in it, the 'onItemSelected' routine catches it just fine. But if a user clicks the same spinner, but does not change from the already visible item that it's currently displaying, the 'onItemSelected' routine just ignores it, and the logs show:- WARN/InputManagerSe...

preventing jCarousel form returning to begining position after loading page

Hi all, i am using jCarousel as a menu in my website. there is a list of links there which is longer than its containing elements and jCarousel is used as a scroll bar to view that list. my problem is that whenever a link is clicked and a new page is loaded, jCarousel resets to its begining position thus sometimes an active link is no ...

How to keep the highlight border of a JComponent, when custom border is set

I have a JTextField, where I've set some custom properties: nameField.setPreferredSize(new Dimension(275,40)); nameField.setBackground(bgColor); nameField.setForeground(txtColor); nameField.setFont(new Font("HelveticaNeue",Font.PLAIN,22)); nameField.setBorder(BorderFactory.createLineBorder(Color.WHITE, 2)); When the component has focu...

Android listview - how to set Focus to listitem's child views?

Hi all, Is it possiable to give Focus on listitem chile views , what i need is i have an custom list view , i creating each row using linear layout with two views like button and textview, now i want to get that button click event and have to change the background color while focusing is it possiable? ...

Focus problem with multiple EditText's.

I have an activity with two edittext controls. I am calling the requestFocus on the second edittext field since by default the focus goes to the first edittext control. The focus appears to be in the second edittext field (the second one gets the highlighted border), but if we try to enter any characters using the hardware keyboard the t...

focus not going to another button in android

Hi, I wrote a code for pinging of given URL.It works fine for me.But whenever i clicked on the start ping button, pinging started but that time focus always is on start button and no widget of the screen working that time. After pressing many times it will gives the force close error.If iam giving URL which is not pinging then that time...

CF - Set Focus to a specific control

Hi ! I have a Form that has a panel with some textBoxes and checkBox that is outside the panel. Every time the Form is loaded the checkBox has focus. I have put en event handler when form loads and tried to set focus on first textbox instead having it on the checkbox. this.Activated += new EventHandler(form_Activated); in the method...

How not to lose focus on a login page

I have a simple login form with 2 input fields: "username" and "password". "username" field is focused by default. The problem is that when user clicks outside "username" or "password" fields, the focus is gone (it is neither on "username" nor on "password" fields"). How can I force the focus to be on these 2 fields only ? In my case, ...

Can multiple HTML elements receive focus at the same time?

I'm a coding a JavaScript reporting component, that requires multiple LI's i.e. lists to be selected collectively as a bunch with visual feedback. I'm thinking of adapting the onfocus event. Is it possible for multiple HTML elements to receive focus at the same time? Not inputs, but DIVs, so I don't need the cursor. I just want several...

UITextField start at end of text

I have a UITextField that displays a long text string. The problem is that when I first open the view containing the UITextField, it automatically shows the end of my text; I want it to show the beginning. I read the UITextField Class Reference on the Apple dev center, but nothing seems to allow me to change it. How can I do this? ...

Initiating UserControl via MVVM in WPF / focus issue.

Hi there I have a few usercontrols loaded into a tabcontrol via MVVM in WPF. Within the XAML for the usercontrol I am setting focus to a textbox using the FocusManager, however this appears to only work when the first instance of the usercontrol is created. Just to test I added a loaded event handler to the usercontrol - this is only ...

Android ListView delete row button - focus issue

Hi! I have an activity with ListView and buttons below: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <ListView android:id="@+id/lvLamps" android:layou...

CF - How to "lose" focus from a control

Hello. I have a control with two buttons (zoom in, zoom out). Both buttons have onClick event that handle the zoom. When any of the button is pressed, the button gets focus and bolds its border and text. Is there a way to disable/remove focus? Actually the solution im looking for would be that on mouseDown the button would receive fo...