focus

Can multiple HTML elements receive focus at the same time?

橙三吉。 提交于 2019-12-17 18:42:00
问题 I'm a coding a JavaScript reporting component, that requires multiple LI's i.e. lists to be selected collectively as a bunch with visual feedback. I'm thinking of adapting the onfocus event. Is it possible for multiple HTML elements to receive focus at the same time? Not inputs, but DIVs, so I don't need the cursor. I just want several DIVs to be "selected" separately from others, colored differently to simulate multiple item selection. 回答1: No, you can only focus on one element at a time.

Focus-follows-mouse (plus auto-raise) on Mac OS X

[亡魂溺海] 提交于 2019-12-17 17:23:46
问题 (I don't want to hear about how crazy I am to want that! :) Focus-follows-mouse is also known as point-to-focus, pointer focus, and (in some implementations) sloppy focus. [Add other terms that will make this more searchable!] X-mouse 回答1: You can do it for Terminal.app by issuing the following command at the command line: defaults write com.apple.Terminal FocusFollowsMouse -bool true For X11 apps you can do this: defaults write com.apple.x11 wm_ffm -bool true In Snow Leopard, use this

How Can I change the way that focus looks like in WPF?

五迷三道 提交于 2019-12-17 16:45:08
问题 The focus visual hint that wpf provides on Windows 7 is a dashed line, as such this: Now, how can I change the way it looks? How can I control its appearence? Thanks! 回答1: Try something like following <Window x:Class="FocusVisualStyle.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"> <Window.Resources> <Style x:Key="MyFocusVisualStyle"> <Setter Property="Control

How to set focus to a control in a Windows Forms application?

廉价感情. 提交于 2019-12-17 16:25:08
问题 In a Windows Forms application, when do I write the code to set the focus to a control both while the application is launched and subsequently after I call a function? For instance, if I have a DropDownList, a TextBox and four buttons and I want the Focus to be set to the DropDownList, where do I write my code? To set the focus to a particular control on application launch, I can set the tab index to that DropDown (with a minimum value, under the assumption TabStop property is set to True).

Which browsers support document.activeElement?

可紊 提交于 2019-12-17 16:24:09
问题 Which web browsers / versions have support for document.activeElement ? This property lets you see which element is active / has focus. Are there any main gotchas/difference between implementations? 回答1: document.activeElement is supported by IE6+, FF3+, Safari 4+, Opera 9+, Chrome 9+. (FF2, Saf3 don't support this property) 回答2: It still doesn't work on WebKit based browsers in xhtml page see https://bugs.webkit.org/show_bug.cgi?id=63922 来源: https://stackoverflow.com/questions/5318415/which

WPF ListBox Image Selected the saga continues

こ雲淡風輕ζ 提交于 2019-12-17 15:42:41
问题 Ok in my ListBox scrolling images w/ text, etc. the saga continues. When I click one of the items, to select it, that runs a process to open a web browser and go to a specific URL. The problem I'm having now is that when the WPF app loses focus, and the web browser opens, the item clicked inside the listbox turns white. Here's the whole ListBox XAML. I have set the selected items to transparent, so does this have something to do with the WPF app losing focus? Is there something I can add tom

WPF ListBox Image Selected the saga continues

微笑、不失礼 提交于 2019-12-17 15:42:09
问题 Ok in my ListBox scrolling images w/ text, etc. the saga continues. When I click one of the items, to select it, that runs a process to open a web browser and go to a specific URL. The problem I'm having now is that when the WPF app loses focus, and the web browser opens, the item clicked inside the listbox turns white. Here's the whole ListBox XAML. I have set the selected items to transparent, so does this have something to do with the WPF app losing focus? Is there something I can add tom

WPF - Remove focus when clicking outside of a textbox

回眸只為那壹抹淺笑 提交于 2019-12-17 15:39:23
问题 I have some textboxes where I would like focus to behave a little differently than normal for a WPF application. Basically, I would like them to behave more like a textbox behaves on a webpage. That is, if I click anywhere outside of the textbox, it will lose its focus. What is the best way to do so? If the answer is to programmatically remove focus, what is the best way to detect a Mouseclick outside of the bounds? What if the element I'm clicking on will be the new recipient of focus? 回答1:

How to prevent going to next row after editing a DataGridViewTextBoxColumn and pressing EnterKey?

妖精的绣舞 提交于 2019-12-17 11:46:32
问题 I'm working on a program with DataGridViews . In one DatagridView there is a DataGridViewTextBoxColumn , which is enabled to be edited by the user. When the user is done with typing the numbers into it, he presses ENTER on the keyboard. Now the DataGridView does all its Events , and after all Events , the last thing is the problem. Everything is done, and Windows is going to Select the next DataGridViewRow , and I'm not able to prevent this. I tried if (e.KeyData == Keys.Enter) e

How to prevent a new WPF form from stealing focus?

旧城冷巷雨未停 提交于 2019-12-17 11:29:42
问题 I have written a simple MSN-style program that will send and retrieve messages using WCF. The main form contains a Textbox to type in the message to be sent. In the background the application polls the server every few seconds for new messages. When a new message is received a new window is opened to display it. This has to be done on the UI thread using the Dispatcher class. The problem is that when the new window is shown, the focus shifts away from the TextBox, so that typing is