Questions tagged [setfocus]

For questions related to the SetFocus method, which moves the focus to the specified form or Window.

The SetFocus method moves the focus to the specified Form, the specified control on the Form/Window, or to the specified Window. You can use the SetFocus method when you want a particular field or control or Window to have the focus so that all user input is directed to this object.

430 questions
3
votes
4 answers

How do I get the Control that is under the cursor in Delphi?

I need the opposite information that the question "How to get cursor position on a control?" asks. Given the current cursor position, how can I find the form (in my application) and the control that the cursor is currently over? I need the handle to…
lkessler
  • 19,819
  • 36
  • 132
  • 203
3
votes
1 answer

Android EditText Focus

I have set a Listener for change in selection of spinner. In the listener I want to focus a EditText field. I have used the following code: text_other_msg.setFocusable(true); It is not working. I also tried with setFocusableInTouchMode. But none is…
dev_android
  • 8,698
  • 22
  • 91
  • 148
3
votes
3 answers

.focus() "set focus on a target input" will not work in Firefox

I have an input field. Under certain conditions I want to keep the user focused on the input field when they hit the Tab key. Basically I'm mimicking the functionality of Google's auto populating search box. I have everything working fine in every…
Stephen Stanley
  • 51
  • 1
  • 1
  • 4
3
votes
2 answers

How to change onfocus attribute with jquery according to tabindex?

I have a list of elements in my page which are ordered with tabindex. What I am looking for is how can I emulate that the tab key was pressed so the focus to move on the next element? I am planning to change focus on my elements in a specific time…
topless
  • 8,069
  • 11
  • 57
  • 86
3
votes
1 answer

WPF- How to set event Up, Down, Left, Right without using the Up, Down, Left and Right Arrow Key?

I am doing HCI (Human Computer Interaction) using face tracking. I am trying to control PC using face. I have 3x3 2 dimensional grid of button. 1 2 3 4 5 6 7 8 9 Suppose, current focus on button 5. if I press up arrow then focus will be on 2, down…
littleBrain
  • 159
  • 4
  • 11
3
votes
1 answer

Can't Set Focus in Safari

I'm trying to set focus to a particular edit field when a page opens or button is pressed. The following simple HTML/Javascript (Test.html) works with Firefox and Chrome but not Safari. Safari will clear the text with the clear button and post it…
glez
  • 1,170
  • 3
  • 16
  • 42
3
votes
1 answer

How Windows Static Control Prevent Input Focus

We know that Static Control in Windows does not receive input focus. But since Static Control in Windows is just a child window, according to what I understand so far, any window should be given input focus when we click on it. So how does Static…
JavaMan
  • 4,954
  • 4
  • 41
  • 69
3
votes
0 answers

Javascript focus() doesn't work in UIWebView if another element already had the focus

I have encountered a Javascript problem in UIWebView: I have two input elements on my webpage, say #focusone and #focustwo

In my…
Velarion
  • 147
  • 1
  • 10
3
votes
2 answers

How do I set combobox background colour when it gets focus

I'm relatively new to WPF, so bear with me. I'm trying to set the background colour of a combo box when it receives focus. I'm setting a trigger in the control template for it's togglebutton to change colour on mouse over, and when it receives…
mockingbird
  • 31
  • 1
  • 4
3
votes
2 answers

How to wait for the full load of a bootstrap modal-dialog loaded with jquery .load() function

I have severals bootstraps modals in my website, and I load them like this : function modal_density(){ $("#modal-content").load("pages/modals/density_control.php"); $('#all_modal').modal('show'); } Then I close them like this : function…
Gauthier
  • 1,116
  • 2
  • 16
  • 39
3
votes
1 answer

c# focus window of a runing program

i want to focus a program from my c# application.i searched lot and found some examples.but i got error .i'm using visual studio.ShowWindow(hWnd, SW_HIDE); line gives me an error "showwindow(system.IntPtr,int) has some invalid argument" plz where is…
Piumi Wandana
  • 220
  • 1
  • 5
  • 14
3
votes
3 answers

SDL2 Raising a window without giving it focus

I need to display a tooltip over a window. I'm creating a second window with the tool tip and using SDL_RaiseWindow() to bring it to the top. However, doing that causes the tooltip to steal focus which is not what I want. Is there a way to bring a…
QuickGrip
  • 143
  • 1
  • 8
3
votes
1 answer

Set focus in Outlook mailitem.To field using c#?

how to i set/change a cursor focus in outlook mailitem.To or Mailitem.Subject field using C#. I already done to create a Addin using Outlook 2010 Addin C#.Now i have an issue to focus change in newmail To,CC,subject Field. How can resolve…
Arjun babu
  • 607
  • 2
  • 13
  • 42
3
votes
1 answer

Set focus to text box from code behind after validation the inputs in asp.net web application

What I want to do is to validate the given input by the user and then set a focus on the invalid input in text box. My save button function is given below. protected void btnSave_OnClick(object sender, EventArgs e) { try { …
user3414435
3
votes
2 answers

Set focus back to its parent?

From post WPF: How to programmatically remove focus from a TextBox, I know how to set a TextBox's focus back to its parent using the following code: // Move to a parent that can take focus FrameworkElement parent =…
herohuyongtao
  • 49,413
  • 29
  • 133
  • 174