focus

DataGrid CurrentItem != SelectedItem after reentry with tab-button

流过昼夜 提交于 2020-01-12 19:16:29
问题 This simple WPF-DataGrid <DataGrid AutoGenerateColumns="False" Height="300" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="dgOriginal" Margin="4,12,0,0" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" IsSynchronizedWithCurrentItem="True" CanUserSortColumns="False" SelectionMode="Single" SelectionUnit="FullRow"> <DataGrid.Columns> <DataGridCheckBoxColumn x:Name="col2Checked"/> <DataGridTextColumn x:Name="col2Name"/> <DataGridTextColumn x:Name=

Underline transition in menu

家住魔仙堡 提交于 2020-01-11 12:51:12
问题 I have a menu with a lava-lamp like underline that looks like this: The underline slides between links when clicking on them. Try a jsfiddle HERE. My only problem is that if you click outside the menu the underline reverts back to it's original state (18%). But I want the underline to stay on the last clicked link when you click outside the menu. I've tried :visited but it doesn't do anything. 回答1: You may be able to do this through CSS, I really don't know. But why don't you just use these 3

Disable focus for tkinter widgets?

最后都变了- 提交于 2020-01-11 10:46:06
问题 How can I make a widget that will not get the focus ever in tkinter? For example, a button that when I will press TAB the focus will skip on him 回答1: I have found some time to provide a working example: import Tkinter import tkMessageBox root = Tkinter.Tk() but1 = Tkinter.Button(root, text ="Button 1") but1.pack() butNoFocus = Tkinter.Button(root, text ="Button no focus", takefocus = 0) butNoFocus.pack() but2 = Tkinter.Button(root, text = "Button 2") but2.pack() root.mainloop() takefocus

Avoid application activation and focus in when clicking buttons on it - Windows API or Qt

試著忘記壹切 提交于 2020-01-11 08:48:07
问题 Situation: A border-less QDialog stays successfully on top of other applications. The problem is when clicking on this always-on-top application window, the following occurs: The clicked always-on-top application gets activated The clicked always-on-top application window steals the focus of previous active/focused app Is there a possibility that when clicking on this always-on-top inactive and unfocused application window, the current application does not loose activation and focus while

Instable focus of WPF apps

拟墨画扇 提交于 2020-01-11 06:48:12
问题 If I have problems with WPF, then it always concerns the Focus-Management. There are cases, my App loses totally focus so that another application gains the focus and my app goes in the background . This happens mainly if some windows in my app will be closed. Is this a known problem of WPF. Does someone else has similar problems? I already opened another thread to this, but no one could help, maybe it was a little to detailed. Therefore this here is the short version. UPDATE It seems that I

Jquery focus on first text field and set cursor at value end for instant data entry

无人久伴 提交于 2020-01-10 08:55:06
问题 I am loading a form and defaulting focus to the first text field. The text field is populated with a default value "PW-". (The first characters of the customers part number like PW-446, PW-9887) They want to just start typing the numbers upon form load instead of clicking to the end of the field, etc to type numbers. The cursor should be blinking at the end of the PW- and ready to go for data input. I have tried many different methods found on StackOverflow with no luck :-( Any ideas? Thanks

jQuery .focus() is highlighting all pre-filled text

杀马特。学长 韩版系。学妹 提交于 2020-01-10 05:06:47
问题 HTML <input id="formloginusername" type="text" name="username" placeholder="Username" value="Pre-filled-from-database"></input> JS: $(document).ready(function() { $("#formloginusername").focus(); }); Problem: The text "Pre-filled-from-database" is highlighted. I only want the cursor to show in the field as if the user had clicked it after the filled text. Thanks! 回答1: Here's a nifty little trick... $(document).ready(function() { var $field = $("#formloginusername"), oldVal = $field.val();

how to prevent focus event in IE when mousedown happens

99封情书 提交于 2020-01-10 03:01:07
问题 event.preventDefault(); return false; event.stopPropagation(); any of them can prevent focus event from happening when I trigger a mousedown event in Firefox and chrome, but it failed in IE.In fact,chrome has another problem. when mousedowning, :hover css is not working. ` <input type="text" id="name"> <div id="suggest"> <div>mark</div> <div>sam</div> <div>john</div> </div> $("#name").focus(suggest.show).blur(suggest.hide); ` what I expected is, when I click the sub div, such as "sam",and

WPF Popup focus in data grid

心不动则不痛 提交于 2020-01-10 02:02:22
问题 I'm creating a custom UserControl to be used inside a DataGrid editing template. It looks like this: <UserControl x:Class="HR.Controls.UserPicker" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:tk="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid> <TextBlock x:Name="PART_TextBox" Text="Hello WOrld" /> <Popup Width="234" Height="175" IsOpen="True" StaysOpen="True" Placement="Bottom" PlacementTarget="{Binding

How to enable commit on focusLost for TableView/TreeTableView?

帅比萌擦擦* 提交于 2020-01-08 14:40:11
问题 Is there any simple approach to let the TreeTableView (or TableView) try to commit values on focus lost? Unfortunatly I didn't succed with any default-implementations of javafx TableCellFactories, which is why I tried my own TreeTableCell implementations and also some different tableCell implementations like the one from Graham Smith, which seemed the most straight forward, since it already implemented a hook for focus lost, but nevertheless the value is never committed and the userchanges