focus

UltraWinGrid enter edit mode issue

橙三吉。 提交于 2019-12-24 05:56:59
问题 I have an UltraWinGrid and I want to give the focus to a specific cell and make it enter edit mode programmatically ( no click ). So I did this : If myUltraWinGrid.ActiveRow IsNot Nothing Then myUltraWinGrid.ActiveCell = myUltraWinGrid.ActiveRow.Cells("foo") myUltraWinGrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode) Else myUltraWinGrid.ActiveCell = myUltraWinGrid.Rows(0).Cells("foo") myUltraWinGrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction

Check if windows/page/document/iframe has focus

百般思念 提交于 2019-12-24 05:41:10
问题 I've asked a similar question already, but I need it for a more specific case so I decided to make a new question to don't mix things up. Check if window has focus 1. I'm making a PTC site, where users get paid by visiting sites for x seconds. 2. The ad view works like this: A new page is opened, containing two things, the top bar with the counter and the iframe which contains the advertiser's site). 3. I want to force the user to see that page for the x seconds that the advertiser paid for.

How to move focus in WPF?

夙愿已清 提交于 2019-12-24 05:04:07
问题 I wonder if there is anyway to change focus from the current control and move it to other control in WPF on TabIndex assigned controls. Example I have controls with TabIndex 1 to 5, is there a way to jumb the focus from 1 to 5 ? <TextBox TabIndex="1" Focusable = "true" LostFocus="test_LostFocus"/> <TextBox TabIndex="2" Focusable = "true"/> ... <TextBox TabIndex="5" Focusable = "true" name="LastControl"/> . private void test_LostFocus(object sender, RoutedEventArgs e) { LastControl.Focus(); }

Xamly set keyboard focus to an element in DataGridTemplateColumn cell?

安稳与你 提交于 2019-12-24 04:52:11
问题 I've set stuff in a DataGridTemplateColumn.CellEditing DataTemplate. I want that when the cell editing loads and shows the template, keyboard-focus should be given to a certain control in the template. Consider this example, when you go edit mode, the textbox is not keyboard-focused: <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <DataGrid

Input field immediately blurs after focus

*爱你&永不变心* 提交于 2019-12-24 03:35:13
问题 According to this answer I try to create a page where if the input field get focused than the height is scaled down small enough that the page will be not scrollable. If the input field lose the focus than everything is made back to the original state. I tried this technique without events only entering the code through the console and it worked like a charm, but after I bind these to events, everything is ruined. I realized that after I click into the input field and the binded function

JSpinner: autoselect onFocus

南楼画角 提交于 2019-12-24 03:13:08
问题 I want to implement autoselect when a user tabs through the JTextFields and JSpinners in my forms. For this I am using this Listener: public class AutoSelect implements FocusListener { @Override public void focusGained(final FocusEvent e) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (e.getSource() instanceof JTextField) { try { JTextField t = (JTextField) e.getComponent(); t.selectAll(); } catch (ClassCastException ex) { // } }else if (e.getSource()

Combo box - typing selection then clicking out of focus - doesn't select the typed item

时光总嘲笑我的痴心妄想 提交于 2019-12-24 02:59:13
问题 I'm having an issue with the combo box. I have an event handler for OnClick which refreshes data based on what item was selected. The problem is when this scenario occurs: Drop-down the combo box to list the various options Type on the keyboard to find a matching item Combo box changes this selection and calls the OnClick event My screen refreshes due to this selection / event Click somewhere outside of the combo box to take the focus away from it Combo box goes back to the previous selection

Bootbox.prompt() set focus on text field

巧了我就是萌 提交于 2019-12-24 02:17:29
问题 I can't seem to set the focus on Bootbox's textfield automatically. here's my code: function setCode(myCode){ bootbox.confirm("Enter your PIN: <input id='pin_code' type='password' name='pin_code'></input>", function(result) { if(result) console.log($("#pin_code").val()); }); $("#pin_code").focus(); }; Perhaps something about bootbox's code is getting in the way? 回答1: You can register a shown event handler that sets the focus (as suggested by @Shiny). However, as of Bootstrap 3 and Bootbox v4

How to bring Inline from a RichTextBox Child into View

不羁岁月 提交于 2019-12-24 02:09:17
问题 How can i focus a Inline in a RichTextBox ? I Create a FlowDocument from a Text-File and load it in my richTextBox1 and mark one Inline after an other accordingly to a Button_click (be recreating the FlowDocument ) with this code: richTextBox1.SelectAll(); richTextBox1.Selection.Text = ""; string text = System.IO.File.ReadAllText(file); int iZeile = 0; string[] split = text.Split(new string[] {"\r\n"},StringSplitOptions.None); foreach (string s in split) { if (iZeile != 27) { paragraph

How to bring Inline from a RichTextBox Child into View

安稳与你 提交于 2019-12-24 02:09:06
问题 How can i focus a Inline in a RichTextBox ? I Create a FlowDocument from a Text-File and load it in my richTextBox1 and mark one Inline after an other accordingly to a Button_click (be recreating the FlowDocument ) with this code: richTextBox1.SelectAll(); richTextBox1.Selection.Text = ""; string text = System.IO.File.ReadAllText(file); int iZeile = 0; string[] split = text.Split(new string[] {"\r\n"},StringSplitOptions.None); foreach (string s in split) { if (iZeile != 27) { paragraph