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
5
votes
1 answer

how to get the focus to a button on pressing the "enter" key in the key board

i have a aspx page with two buttons,"close" and "submit" button.when i press the enter key in the keyboard the focus automatically goes to "close" button and closes the page.Instead i want the focus to be focused on the "submit" button on pressing …
subash
  • 4,050
  • 14
  • 51
  • 78
5
votes
3 answers

How to re-focus to a text field when focus is lost on a HTML form?

There is only one text field on a HTML form. Users input some text, press Enter, submit the form, and the form is reloaded. The main use is barcode reading. I use the following code to set the focus to the text field:
ohho
  • 50,879
  • 75
  • 256
  • 383
5
votes
2 answers

requestFocus() returning false

I am inflating a view when a button is pressed. The inflated view is like a dialog box, however when I try to get focus on the dialog box with requestFocus(), requestFocus() returns false means I am not getting focus on the view, but when I manually…
Naruto
  • 1,710
  • 7
  • 28
  • 39
4
votes
4 answers

How to set focus on specific JTextfield inside JOptionPane when created?

I want to set the focus on a specific JTextField which is passed to the JOptionPane as Object Message. Here is my code (I want the focus on txt2 but the focus always is on txt1): import java.awt.*; import java.util.*; import javax.swing.*; public…
Eng.Fouad
  • 115,165
  • 71
  • 313
  • 417
4
votes
0 answers

React Native Accessibility Set Focus

I am adding accessibility to a React Native project and I can't seem to figure something out. I am using javascript AccessibilityInfo.setAccessibilityFocus(reactTag); to change the focus to a desired component on the page. While using the…
4
votes
2 answers

How to focus Textbox with Alt + letter

I need to quick focus the text box using Alt+Letter combination. In my form for each textbox is a label. For this label I can specify name as '&My Label' and M letter will be underlined when I press the Alt button. But how I can focus the textbox…
Yuriy
  • 2,670
  • 6
  • 33
  • 48
4
votes
4 answers

How to SetFocus on a TextBox in the Form Load

Working in both A2003 & A2007. How do we ensure that a selected TextBox gets the focus when the form loads? If we put MyTextBox.SetFocus in the Form_Load then we get the error: can't move the focus to the control This form is designed for rapid…
hawbsl
  • 15,313
  • 25
  • 73
  • 114
4
votes
1 answer

Vuejs, I need to reset page focus on route change

In a SPA,, specifically Vuejs, I need to reset the tab index of the page when I access a new route I tried this: watch: { $route (to, from) { document.getElementById('content').focus() // or // document.body.focus() …
GRowing
  • 4,629
  • 13
  • 52
  • 75
4
votes
1 answer

Froala editor: focus cursor on page load

I thought something like this would be simple, but apparently not. I'm using a paid version of the Froala Editor, and I love it. However, it needs to focus the cursor when the page loads inside the editor so I don't have to force my users to…
Dan L
  • 4,319
  • 5
  • 41
  • 74
4
votes
3 answers

Why are there 2 setFocusable methods in Android?

I was trying to set the focusability of a component and found these two methods, hoping I could use them to make the component only focusable when the user touches it, not when requested…
Ky -
  • 30,724
  • 51
  • 192
  • 308
4
votes
2 answers

Android mapView ItemizedOverlay setFocus does not work properly

Calling setFocus(null) on the ItemizedOverlay does not 'unfocus' current marker. According to the documentation: ... If the Item is not found, this is a no-op. You can also pass null to remove focus. Here's my code: MapItemizedOverlay public…
grzaks
  • 1,404
  • 2
  • 18
  • 31
4
votes
3 answers

jquery set focus to dynamically generated element

I've run into this a number of times, where I wish to reset focus to (and or select the contents of) a dynamically generated element after failing some or other validation (typically on change or blur), but I have never come up with a satisfactory…
WallabyKid
  • 503
  • 2
  • 5
  • 16
4
votes
4 answers

Set Focus to Internet Explorer Object in Visual Basic

Does anybody know how to set focus onto an IE object with Visual Basic? I've tried myieobject.SetFocus, but the compiler errors with this statement.
Lloyd Banks
  • 35,740
  • 58
  • 156
  • 248
3
votes
1 answer

Touch-To-Focus on cameraOverlayView in iOS 5?

I used to have touch to focus on my cameraOverlayView (in UIImagePickerController), but once I updated to iOS 5 it doesn't work. I used a custom view class which I applied to my view in cameraOverlayView. I made sure everything is connected and…
3
votes
4 answers

Giving focus back to main form

I have a C# app with two forms. The first one is the main form which should always be open. The second one is a preview pane which the user can enable. When the user selects to show the preview pane (menu option), the preview pane gets opened. Which…
PeeHaa
  • 71,436
  • 58
  • 190
  • 262