click

How can I differentiate between single and double clicks in .Net?

流过昼夜 提交于 2019-12-05 21:04:21
问题 I want to override OnMouseClick and OnMouseDoubleClick and perform different actions depending on which click style was used. The problem is that OnMouseClick is happening for both single and double clicks, and is getting called before OnMouseDoubleClick. I'm certain this must be a common requirement, so I guess I'm missing something pretty obvious. Can someone fill me in? Edit to add: the MouseEventArgs.Clicks count doesn't help. In the case of a double-click, the first click is handled as a

getting correct click coords with ggplot map in shiny

喜欢而已 提交于 2019-12-05 20:56:45
I have the start of a shiny app with a ggplot map of the world. I would like to get the coordinates of the click on the plot so users can do things with the map, but the coordinates are very strange (either NULL or something very small). Clicking repeatedly only seems to change one coordinate: ui.R: library(shiny) # Define UI for application shinyUI(pageWithSidebar( # Application title headerPanel("My App"), sidebarPanel( textOutput("clickcoord") ), # Show a plot of the generated distribution mainPanel( plotOutput("myworld", height="600px", clickId="plotclick") ) )) server.R: library(shiny)

Programmatic button click throws 'System.StackOverflowException' exception

蓝咒 提交于 2019-12-05 20:18:02
问题 I have written a WinForms program in C#.Net to click a button programmatically within a password form. Form1 loads and shows Form2 as a dialogue box. The application will close if DialogResult is anything other that DialogResult.OK. So far I have a button click event, which is coded as follows: if (txtpass.Text == "") { MessageBox.Show("You need to enter a password", "Password", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); txtpass.Focus(); } else { if (txtpass.Text == "1234") { radButton1

Selenium webdriver click vs action.click whats the difference?

两盒软妹~` 提交于 2019-12-05 19:22:32
问题 I was struggling with a popup dialog in a website I'm automating, for some reason it wouldn't click a button in the dialog but interacted fine with everything else fine. It was also identifying the button without issue and I could see when watching it run that it did seem to click the button as the colour changed, so I was a bit stuck. My code originally looked pretty obvious: - WebElement targetElement = waitforElement(threadSesh); targetElement.click(); But when I changed it to the

Click on icon in a JTextField and clear its content

做~自己de王妃 提交于 2019-12-05 18:58:15
I am trying to create a JTextField with an image and a hint. The function of the textfield is a search field to search some books. Now, I like to go a little bit further. I would like to give the image a function. For example, if I click on the image the text in the textfield should be cleared. To achieve this implementation I created a new class and extended it with JTextField. This is the code: public class JSearchTextField extends JTextField implements FocusListener { /** * */ private static final long serialVersionUID = 1L; private String textWhenNotFocused; private Icon icon; private

How to detect if the Control.Click event was by the mouse, keyboard, or something else?

末鹿安然 提交于 2019-12-05 18:54:20
How can I tell if a Control.Click event was triggered by the mouse or by the keyboard? Edit: Handling MouseClick and KeyPress does't work for me, because then how would I know if something else triggered the click? (e.g. PerformClick ) You can't. Use the Control.MouseClick event and the Control.KeyPress event so you can tell the source of the event. And remember that a space on the control with focus and a Ctrl+ key can generate a click on a button as well. You can not tell, but you can use MouseClick and KeyPress if you need to know what originated the event. void handler(object sender,

How to automate a 'triple-click' using Java & Selenium?

こ雲淡風輕ζ 提交于 2019-12-05 18:45:39
I'm automating tests that deal with text, and I need to be able to select an entire paragraph. In order to do this (at this point) I need to automate a triple click. Any idea how to do that? This is what I've attempted so far, neither works: action.click().click().click().perform(); //and... for(int i=0; i<3; i++) { action.click().perform(); } It's been a while, but I believe this was the solution that ended up working for me: import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; public void tripleClick() { Actions action = new Actions(driver); WebElement

Tablets hover on first click, click on second click

☆樱花仙子☆ 提交于 2019-12-05 18:44:27
Posting this question largely in the hopes of confirming my suspicions of the behaviour, and thus documenting it for other programmers. (Since I found no record of this anywhere online) I have a site that I'm building, whose nav bar has the following properties: The horizontal section is a <ul> of <li> s and some of the <li> s hav both: A n <a> element taking you to that topic. A hover CSS selector that triggers display:block on a submenu - a nested <ul> which then drops down vertically. On a desktop this all behaves as I'd expect: hovering on the key element exposes the submenu, and clicking

affect only the clicked element in jquery for multiple elements with same class

≯℡__Kan透↙ 提交于 2019-12-05 17:18:59
i've been looking all over for a solution to this but i just can't figure out how. what i want is for the specific header that was clicked to be the only one to expand. demo is here: http://jsfiddle.net/bm92L0eg/1/ html: <h3 class="click-list">header a</h3> <ul class="open-list"> <li>item</li> <li>item</li> <li>item</li> </ul> <h3 class="click-list">header b</h3> <ul class="open-list"> <li>item</li> <li>item</li> <li>item</li> </ul> <h3 class="click-list">header c</h3> <ul class="open-list"> <li>item</li> <li>item</li> <li>item</li> </ul> jquery: $('.click-list').click(function() { $(this)

VBA Check if button has been clicked

♀尐吖头ヾ 提交于 2019-12-05 17:12:12
I think this is an easy fix, but I've been stuck at this trouble spot for hours now. Basically in the excel worksheet I have two buttons assigned to macros: 1 and 2. If the user clicks 1 first and then clicks then 2, 2 runs off of some of the variables from 1. But I need 2 to be able to operate independently if 2 is clicked first. Therefore, I need some way in the 2 code to ask if 1 button has been clicked. Both 1 and 2 are public subs. I think there is something that I am missing with the definitions, but I'm not sure. Simple Sample: Public Sub 1() do this End Sub Public Sub 2() If 1 clicked