focus

WPF: Cannot set focus

烈酒焚心 提交于 2020-01-01 05:34:06
问题 I want that from the PreviewTextInput handler a new control is created and focus is set to it. But even after calling Focus() on the new control, the cursor is still in the old textbox. The handler UserControl_PreviewTextInput is registered on the UserControl which contains this textbox if this matters. private void UserControl_PreviewTextInput(object sender, TextCompositionEventArgs e) { CodeLineControl el = new CodeLineControl(); container.Children.Insert(idx+1, el); el.innerTextBox.Focus()

In Applescript, how can I find out if a menu item is selected/focused?

时光总嘲笑我的痴心妄想 提交于 2020-01-01 05:29:10
问题 I have a script for OS X 10.5 that focuses the Search box in the Help menu of any application. I have it on a key combination and, much like Spotlight, I want it to toggle when I run the script. So, I want to detect if the search box is already focused for typing, and if so, type Esc instead of clicking the Help menu. Here is the script as it stands now: tell application "System Events" tell (first process whose frontmost is true) set helpMenuItem to menu bar item "Help" of menu bar 1 click

Weird behaviour in Android browser when selecting fields

三世轮回 提交于 2020-01-01 04:42:07
问题 The Android Webkit browser (tested on 2.2, 2.3, and 3.0) seems to behave in weird ways when modal elements are put one above the other. In this example here ... I'm displaying a jQuery UI date picker with z-index 200, a gray overlay div spanning the whole document height and width with z-index 199 and behind all that is the regular form. In the example above, I have clicked on the dropdown control for the year where it says 2011. Instead of selecting that dropdown, the focus went on the

How to give focus() after an alert()?

徘徊边缘 提交于 2020-01-01 04:41:33
问题 I have something like: <input type="textbox" id="partNumber" onChange="validatePart(this);"> <input type="textbox" id="quantity" onfocus="saveOldQuantity(this);"> The onChange event is properly firing after a change is made and the textbox loses focus. When quantity gains focus, the onfocus event is properly firing to save the old value of quantity before changes are made. If validatePart() detects an invalid partNumber value, it alert s the user to that fact. After the alert() has cleared, I

Strange focus behavior for simple WPF ItemsControl

£可爱£侵袭症+ 提交于 2020-01-01 03:39:51
问题 I'm seeing strange behavior when it comes to focus and keyboard navigation. In the example below I have a simple ItemsControl that has been templated so that it presents a list of CheckBoxes bound to the ItemsSource. <ItemsControl FocusManager.IsFocusScope="True" ItemsSource="{Binding ElementName=TheWindow, Path=ListOStrings}"> <ItemsControl.ItemTemplate> <DataTemplate> <CheckBox Content="{Binding}" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> For some strange reason the

how to get focus-follows-mouse over buffers in emacs?

我怕爱的太早我们不能终老 提交于 2020-01-01 02:05:48
问题 Suppose I have a source file open and I launch a shell. I can hit C-x o to switch between the two buffers. But how can I get it so that when I move the mouse the buffer under the mouse gets focus, just like the "focus follows mouse" option common in window managers? 回答1: Set: (setq mouse-autoselect-window t) 回答2: Answering the shift+arrow comment, do in your .emacs: (windmove-default-keybindings) 来源: https://stackoverflow.com/questions/898401/how-to-get-focus-follows-mouse-over-buffers-in

Set Focus for Primefaces Component in Bean with WidgetVar with RequestContex Execute

不羁岁月 提交于 2019-12-31 07:22:08
问题 Is there a way to set my component focus after an function call to an other component with Primefaces RequestContex? i tried: RequestContex.getCurrentInstance().execute("PF('WidgetVar').focus();"); and RequestContex.getCurrentInstance().execute("(((InputText) event.getComponent()).getWidgetVar()).focus();"); I dont get an error but nothing happens. Did i miss something or is this not possible? I use Primefaces 4.0.3 and MyFaces 2.0.2 EDIT Example Code Bean import java.io.Serializable; import

VirtualKeyboard not Show when focus Edit fields in Firemonkey project

旧街凉风 提交于 2019-12-31 05:14:53
问题 I have a Firemonkey multi device project in Delphi 10 Seattle where the user can get a screen at the start of the app. Here the user needs to fill in 2 fields. But when I click on the edit fields the Virtual Keyboard isn't shown. If I skip this screen at start and call it later then the Virtual Keyboard is shown. This is done in the same way too. I found sort of a solution: When i click on the edit fields i call show VirtualKeyboard myself. The only problem is that the cursor isn't shown in

Image gone After Focusing

人走茶凉 提交于 2019-12-31 05:10:21
问题 This is before focus state. It work fine. This is on focusing state. It work fine. This is after focus state. It occurred problem where the image gone. It works fine for the top right but top left image got problem. Here is my custom VerticalFieldManager : public class Custom_TopField extends HorizontalFieldManager implements FieldChangeListener { private Bitmap bg = Bitmap.getBitmapResource("header_bar.png"); private Bitmap download = Bitmap.getBitmapResource("btn_download.png"); private

Focus issue on Form Load

我只是一个虾纸丫 提交于 2019-12-31 05:10:10
问题 I have an ActiveX control (written in VB 6.0 or C++ maybe) that we are using as an AxInterop in a C# WinForms program. It is very much like a text box but with some special logic etc... and we have added it to a toolbar. When the form loads I want the keyboard focus to be inside this control, so I used .Focus and .Select methods on it but still it does NOT get the focus. When I run from Visual Studio, the control gets the focus. When I run outside of the IDE, the control does not get the