event-handling

Event Handler not being added to new Mail Items

眉间皱痕 提交于 2019-12-31 04:32:12
问题 I'm trying to create a simple Outlook 2010 add-in that responds to new attachment events. The code below only works when I uncomment the MessageBox.Show line. But with it removed it appears not to add the event handler. What am I missing about the program flow that means that a modal message box affect the placement of event handlers? public partial class ThisAddIn { private void ThisAddIn_Startup(object sender, System.EventArgs e) { Application.Inspectors.NewInspector += Inspectors

Method name expected c#

守給你的承諾、 提交于 2019-12-31 04:29:34
问题 I have an event handler, i would like to pass some parameters to the event like this, that line trigger an error: method name expected p.Click += new System.EventHandler(P_Click(sender, new MyEventArgs { design = reader1["desig_prd"].ToString(), prix = (float)reader1["prix_prd"] })); my P_Click event public void P_Click(Object sender, EventArgs e) { var args = (MyEventArgs)e; string deignation = args.design; MessageBox.Show(deignation); } and i have class MyEventArgs like this class

Cross-browser handling the “Enter” key pressing using Javascript

拥有回忆 提交于 2019-12-31 03:59:05
问题 I have got the following sample, that easily detects the "Enter" key pressing and handles it correctly. Here it is: <!DOCTYPE html> <html> <head> <title>keyCode example</title> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#search-input").keyup(function (event) { event = event || window.event; if (event.keyCode == 13 || event.which == 13) { $("#search-button").click(); } }); $("

iTextSharp - Text overlapping image

这一生的挚爱 提交于 2019-12-31 02:25:07
问题 I'm using iTextSharpText to build a PDF. I was asked to add some dynamic text over an image. I've already tried some examples that I found on this forum and other websites, but I can't seem to get this right, and it's really driving me nuts. I followed this thread (iTextSharp Adding Text plus Barcode in a single cell?), and tried both answers. First I tried: var img_operacao = Image.GetInstance(String.Format("{0}{1}", Settings.Default.SiteRootURL, "/PublishingImages/PDF_operacao.png")); img

Forward event to all components JAVA

浪子不回头ぞ 提交于 2019-12-30 11:49:39
问题 i dont how to solve this problem. I am developing a graphical editor, where arc(line) drawing is possible. I manually set the size of arc component to 1000x1000, so i dont have to change it when this arc will be dragged & dropped. Then i paint into this component the arc of the desired dimensions. Every arc components have mouse listener installed. The problem is, that only the most upper arc component get the mouse message. Also i have a mouse click listener installed on the JPane itself,

Javascript mouse event not captured properly when mouse moved very fast

最后都变了- 提交于 2019-12-30 10:56:39
问题 I am using JavaScript mouseover and mouseout events when I move my mouse very quickly the events are not triggered. Can you tell me what the problem is? Please let me know how to solve this. Also let me know if anything else is needed. Here is the code HTML 4 => qq[ <ul id="primary"> <li id="firstTab" onmouseover="changeSecondaryMenu('index','explore');" onmouseout="changeSecondaryMenu('explore');"><a></a></li> <li id="secondTab" onmouseover="changeSecondaryMenu('home','explore');" onmouseout

TFS 2013 event handling on work item change

a 夏天 提交于 2019-12-30 07:48:13
问题 I would like to develop software which runs every time a work item is being created or changed in a TFS team collection. My TFS server version is 2013 and i'm planning to upgrade soon to 2015. I tried the following article but it doesn't work on 2013... What do you recommend? 回答1: Found the answer! here's my code: using Microsoft.TeamFoundation.Common; using Microsoft.TeamFoundation.Framework.Server; using Microsoft.TeamFoundation.WorkItemTracking.Server; using System; using System

javascript bind an event handler to horizontal scroll

此生再无相见时 提交于 2019-12-30 06:10:09
问题 Is there a way in javascript to bind an event handler to a horizontal scroll as opposed to the generic scroll event which is fired when the user scrolls horizontally and vertically? I want to trigger an event only when the user scrolls horizontally. I searched around for an answer to this question, but couldn't seem to find anything. Thanks! P.S. My apologies if I'm using some terminology incorrectly. I'm fairly new to javascript. UPDATE Thanks so much for all your answers! In summary, it

WPF: How to prevent a control from stealing a key gesture?

▼魔方 西西 提交于 2019-12-30 05:52:22
问题 In my WPF application I would like to attach an input gesture to a command so that the input gesture is globally available in the main window, no matter which control has the focus. In my case I would like to bind Key.PageDown to a command, however, as soon as certain controls receive the focus (e.g. a TextBox or TreeView control), these controls receive the key events and the command is no longer triggered. These controls have no specific CommandBindings or InputBindings defined. This is how

What is the best practice to not to override other bound functions to window.onresize?

左心房为你撑大大i 提交于 2019-12-30 05:39:09
问题 How much I dig into JavaScript, I find myself asking that much. For example we have window.onresize event handler and if I say: window.onresize = resize; function resize() { console.log("resize event detected!"); } Wouldn't that kill all other functions which is connected to the same event and just log my message in console? If so I think there should be another notifier which tells me about window resize event - or a workaround maybe - without overriding other functions which are bound to