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
0 answers

How can I manually set a focus area in Android?

I have built a small camera app for android. Now I would like to know how I can tell my app (or better tell the camera) that it should focus on say the upper left corner of my preview. How can I do that? Which methods can I use to set the focus on…
user2426316
  • 7,131
  • 20
  • 52
  • 83
3
votes
3 answers

MFC: How to catch set focus of each control of dialog in one function

I have "n" dialogs which have the same base dialog. Each dialog has its own controls edit boxes combo boxes list controls etc. In base dialog, how do I set focus messages of each control and,for example, give a Message box with text("Hello I got…
3
votes
1 answer

Chrome Extension: blank new tab + address bar focus

I'm using this extension to get a blank page each time I open a new tab, unfortunately the address bar is not focused after the new tab is open. I changed the new page contents to dispatch the keystroke 9 to simulate the tab key. which causes the…
rraallvv
  • 2,875
  • 6
  • 30
  • 67
3
votes
1 answer

winapi C++ Handling Focus

I am working on a C++ winapi app and I am struggling to get SetFocus() to work for me. I create the Main window with WS_OVERLAPPEDWINDOW | WS_VISIBLE and then within that I create its children (a couple of buttons and the beginnings of my own…
Shane Haw
  • 723
  • 9
  • 22
3
votes
2 answers

how to perform setfocus(); to the dropdown list

I'm having a dropdown list which loads the records from DB on OnLoad() event, I want to set focus on the dropdown box when the page loads. I have tried many ways to set focus but its not working. pls look at the code below. HTML CODE is as follows, …
madhu
  • 1,010
  • 5
  • 20
  • 38
3
votes
2 answers

SetFocus can only be called before and during PreRender

Can anyone tell me why I would be getting the error in the below trace? "SetFocus can only be called before and during PreRender." The error message says that "SetFocus" must be called before or during PreRender and based on the trace the page has…
user1723569
3
votes
1 answer

SetForegroundWindow in Remote Desktop Connection

I have an application in C# which sends keys to another program. To do that I call SetForegroundWindow method before sending keys which works. Problem is when I am connected to the computer using RDC and minimize the RDC window or disconnect it then…
Ali
  • 1,801
  • 6
  • 43
  • 58
2
votes
2 answers

VBA Excel setfocus on Dropdown box

I am trying to set the focus in Excel through VBA code towards a dropdown box. I have tried various things which bring unwanted results. The item below is the only one I have got to focus on the drop down box but it is selecting the dropdown as if…
karlstackoverflow
  • 3,298
  • 6
  • 30
  • 41
2
votes
2 answers

Focus On Textfield In JQuery Dialog Content Not Working

I am having problem forcing focus on a textfield in the content of a JQuery dialog content, which is dynamically generated. I have googled about this and it seems that if the Jquery dialog is set as modal, JQuery "steals" the focus at the document…
asyadiqin
  • 1,637
  • 3
  • 19
  • 25
2
votes
1 answer

jquery trigger focus and cursor movement

Is there any way to trigger the focus() event on a