click

Clicking HyperLinks in a RichTextBox without holding down CTRL - WPF

荒凉一梦 提交于 2019-11-28 00:53:33
I have a WPF RichTextBox with isReadOnly set to True . I would like users to be able to click on HyperLinks contained within the RichTextBox, without them having to hold down Ctrl . The Click event on the HyperLink doesn't seem to fire unless Ctrl is held-down, so I'm unsure of how to proceed. I found a solution. Set IsDocumentEnabled to "True" and set IsReadOnly to "True". <RichTextBox IsReadOnly="True" IsDocumentEnabled="True" /> Once I did this, the mouse would turn into a 'hand' when I hover over a text displayed within a HyperLink tag. Clicking without holding control will fire the 'Click

How to use addEventListener

落花浮王杯 提交于 2019-11-28 00:28:01
问题 I was making a script that creates div elements each time a button is pressed. Originally I had the function called inline with the onclick attribute, but jslint doesn't like that so I moved it out and instead tried to use addEventListener("click",function()); I've never used addEventListener() before so I'm not even sure I am using it correctly. The problem is that it creates one div when the page loads and won't do anything when the button is pressed. Thank you in advance. here is what I

How to get the position of a Click?

◇◆丶佛笑我妖孽 提交于 2019-11-27 22:51:51
I'm currently making a game where the player will click on one of his units (which are pictureboxes) and a circle will become visible with the player's unit in the center. (Circle is also a picturebox) When the player clicks on the picturebox of the circle I need to figure out if the position of the click is inside the radius of the circle. My question is how do I get the position of the click? In click handler do: MousePosition.X MousePosition.Y Add example: // // pictureBox1 Init // this.pictureBox1.Location = new System.Drawing.Point(1, 1); this.pictureBox1.Name = "pictureBox1"; this

Scroll on hover, click for speed

扶醉桌前 提交于 2019-11-27 22:32:09
I am trying to make my page scroll when you hover on a div. This is what I got so far $(document).ready(function() { $("#hoverscroll").mouseover(function() { var div = $('body'); setInterval(function(){ var pos = div.scrollTop(); div.scrollTop(pos + 1); }, 100) }); }); http://jsfiddle.net/3yJVF/ However, there are two things left to do. I need it to increase speed each time you click, stop when you're no longer hovering and reset the speed back to default. I'm trying to achieve something like this: $(document).ready(function() { $("#hoverscroll").mouseover(function() { var div = $('body');

EventHandler with custom arguments

♀尐吖头ヾ 提交于 2019-11-27 22:20:51
I've been looking for an answer for about an hour on Google but I did not found exactly what I'm looking for. Basically, I have a static Helper class that helps perform many things I do frequently in my App. In this case, I have a method named "CreateDataContextMenu" that creates a context menu on a given TreeView control. public static void CreateDataContextMenu(Form parent, TreeView owner, string dataType) { ... } TreeView owner is the control in which I will associate my context menu. Then later on I add a Click event to a MenuItem like this: menuItemFolder.Click += new System.EventHandler

Android: Button click event

心已入冬 提交于 2019-11-27 22:11:21
问题 I have 2 buttons in my xml file with RelativeLayout. In my class I have extended Dialog & implemetned OnClickListener and also added OnClick(View v) method. But somehow the onClick code is never executed when the button is clicked. Can anyone help me find the problem with my code : <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation=

Uncaught ReferenceError: Invalid left-hand side in assignment

梦想与她 提交于 2019-11-27 21:54:25
<script> function urlencode(str) { return escape(str).replace('+', '%2B').replace('%20', '+').replace('*', '%2A').replace('/', '%2F').replace('@', '%40'); } $('input#q').keyup(function(e) { if(e.keyCode == 13) { if($('input#q').val().length > 2) { $('input#q').val() = urlencode($('input#q').val()); document.search_form.submit(); } } }); $('input#search').click(function() { if($('input#q').val().length > 2) { $('input#q').val() = urlencode($('input#q').val()); document.search_form.submit(); } }); </script> when i click the search button i get the following error : "Uncaught ReferenceError:

open a url on click of ok button in android

前提是你 提交于 2019-11-27 19:54:41
问题 I have to open a URL on Click of OK Button in a view. Can someone tell how to do this? 回答1: On Button click event write this: Uri uri = Uri.parse("http://www.google.com"); // missing 'http://' will cause crashed Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); that open the your URL. 回答2: Button imageLogo = (Button)findViewById(R.id.iv_logo); imageLogo.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method

Bind a jquery image zoom effect to onclick

本秂侑毒 提交于 2019-11-27 19:27:55
问题 I'm using this plugin to enable an image zoom on my site: http://www.elevateweb.co.uk/image-zoom/ I modified the code so that the magnifying glass only appears when you click the image (the mouse cursor is a magnifying glass when you hover over the image to suggest that you can click to zoom). The code looks like the following: $("#mainimage").click(function() { $("#mainimage").elevateZoom({ zoomType: "lens", lensShape: "round", lensSize: 300 }); }); This code works fine. But what I'd like to

jQuery .click() works on every browser but Safari

让人想犯罪 __ 提交于 2019-11-27 19:00:21
I have a piece of JavaScript that dynamically creates an A tag inside of an existing div and then calls the jQuery function "click" on it. This works as intended in all browsers except Safari. Safari returns the following error: 'undefined' is not a function (evaluating '$('.shell a')[0].click()') Any ideas on what I'm doing wrong or why this doesn't work in Safari and how to get it to work (or one piece of code that works in all browsers) I've tried using .trigger("click") as well and it gives the same error. JavaScript function writeAndClickLink(url) { $('.shell').html('<a href="' + url + '"