focus

How to deselect textbox if user clicks elsewhere on the form?

烈酒焚心 提交于 2019-12-23 09:35:06
问题 Currently in my application it is impossible to deselect a textbox. The only way is to select another textbox. My users and I agree that clicking anywhere else on the form should deselect the current textbox. I tried overriding the MouseDown on many controls and having the focus set to a random label but it doesn't work for some controls like the MenuStrip or scrollbars. Any ideas? 回答1: Assuming you have no other controls on your forum, try adding a Panel control that can receive focus. Set

WPF Editable Combobox IsFocused problem

若如初见. 提交于 2019-12-23 08:50:06
问题 I am developing a Watermarked ComboBox by modifying the ComboBox ControlTemplate . Everything is fine when the ComboBox is not in an editable mode, but when I change the edit mode to True, the IsFocused property is never set to True. This is because in edit mode, the ComboBox is using a TextBox . This is an exact copy of this StackOverflow question: . There are no responses to that question. Please drop a line if you know how to solve this, or please point me to links that provide a Watermark

Is it possible to click a Button without ever losing focus on a TextBox?

自古美人都是妖i 提交于 2019-12-23 08:04:20
问题 I am trying to develop a touchscreen keyboard control in a C# WPF project that will be visible when a TextBox gets focus and is hidden when the TextBox loses focus. The projects I have seen for touchscreen keyboards have accomplished this by defining the keyboard as a new window rather than a control. For my application, I would really like to have the keyboard as a control within the main application window. Is there a way to allow a button to be clicked (on the keyboard control) without

Qt4: adjust which widget get focused on start

自闭症网瘾萝莉.ら 提交于 2019-12-23 07:58:13
问题 If I don't re-implement QMainWindow::showEvent() (which will contains a setFocus() method for that widget), is there any way to let some widget get focused first, when the window is loaded ? I use form editor of Qt4, but failed to find somewhere to configure that. 回答1: You can set the Tab Order in Qt Designer or the Designer component in Qt Creator. The first widget in the tab order should get focus on load. Many users expect to be able to navigate between widgets and controls using only the

set focus to iframe body/content in firefox?

☆樱花仙子☆ 提交于 2019-12-23 07:46:16
问题 i have an ifram, which has hidden visibility. i click on button - iframe will be visible and i want to focus on its body/content. because now i must click on button and then into iframe, so thats two clicks. i want to do it on one click, but dont know how to focus in firefox. in explorer it is ok: var iframe_window = window.frames["myFrame"]; iframe_window.document.body.focus(); try lot of examples for firefox, but they dont work. anybody know how to do it in firefox ? thanks. 回答1: Try to set

Do mouse clicks bring keyboard focus to focusable controls by default?

China☆狼群 提交于 2019-12-23 07:43:03
问题 This question can seem quite odd but from all my experience I've gotten used to setting keyboard focus to the focusable element just by clicking it with the mouse; however, UserControl with the properties Focusable = true and IsTabStop = true came as a surprise to me because it gets keyboard focus via Tab but stays ignorant to mouse clicks. 回答1: Handle the click event on the UserControl and add this code to the eventhandler: private void UserControl_OnMouseUp(object sender,

How to keep matplotlib (python) window in background?

纵饮孤独 提交于 2019-12-23 07:39:04
问题 I have a python / matplotlib application that frequently updates a plot with new data coming in from a measurement instrument. The plot window should not change from background to foreground (or vice versa) with respect to other windows on my desktop when the plot is updated with new data. This worked as desired with Python 3 on a machine running Ubuntu 16.10 with matplotlib 1.5.2rc. However, on a different machine with Ubuntu 17.04 and matplotlib 2.0.0, the figure window pops to the front

How to disable focus for the first input in a Primefaces Dialog?

拟墨画扇 提交于 2019-12-23 07:22:07
问题 I have a Dialog in my Page, which contains a input field (Date, Calendar) . The problem is that the calendar opens directly after opening the dialog, because the focus is set on the first input. Is there a way to disable focus in Primefaces? 回答1: You can change the default behavior; http://forum.primefaces.org/viewtopic.php?f=3&t=29050 You can always override default behaviors of widgets, for example to prevent calendar focus on dialog opening; PrimeFaces.widget.Dialog.prototype.applyFocus =

My application stealing focus

匆匆过客 提交于 2019-12-23 06:49:24
问题 Im developing an application and use FlashWindowEx to flash the update window however it always manages to steal focus from full screen applications like games and such. This is not what i want and is very annoying. Is there any way to work out whats causing it to steal focus (tried commenting out FlashWindowEx but it still did) or a way to tell it not to steal focus. This happens on all versions of windows (including 7) and the game is launched seperatly to the application. 回答1: Check out

CSS3 Skew Again! : Unskew text without parent div so form focus state is proper

一曲冷凌霜 提交于 2019-12-23 05:38:08
问题 I have a simple problem, but I may be asking for the impossible. I want to style my html form elements as parallelograms without skewing the contained text. I would normally do this by applying the transform to a parent div and applying the reverse transform to the content: http://jsfiddle.net/ExUs9/3/ form { background:#62CAD9; padding:10px; } div { background: white; height: 30px; margin: 10px; width:300px; transform:skewX(30deg); -ms-transform:skewX(30deg); -webkit-transform:skewX(30deg);