events

YUI custom events and simutaneous actions

I'm working on a JavaScript application that has to perform two separate checks via AJAX. Depending on the result of each check, behavior differs. The case I'm interested in here is when both checks are successful. I've identified a few ways to do this, and I want to get some feedback from SO about what they think the best approach is...

prototype/javascript - firefox not firing keypress/keydown event unless focus is in textbox

The following works fine on IE6, IE7, and chrome. Not working on ff 3.0.7. <html><head> <script src="prototype.js" type="text/javascript" ></script> <script type="text/javascript"> Event.observe(window, 'load', function(){ Event.observe(document.body, 'keydown', myEventHandler); alert('window load'); }); function myE...

Registering to "this" object's own event handler within "this" method.

I would like to provide a deafult implementation for an event generated by an instance of “Authenticator” (hereafter “objAuthenticator”). Is this an acceptable practice to provide such method that registers for handling objAuthenticator’s own event to provide a deafult implementation? And also, if it is an acceptable pratice, I have tw...

Handling System.IO.IOException For Multiple Connections

I want to create an app to monitor the event logs of multiple servers remotely all is good however the servers are likely to be offline now and again. When i connect to a remote event log and the connection to the machine is lost a System.IO.IOException is thrown, I would like to hadle the error by connecting again to the remote server ...

javascript: setting a.onclick doesn't work at first run

Hi, I use code like this to dynamically create some link-based controls: <script type="text/javascript"> function BuildControls (id, ...) { var div = document.getElementById (id); /* some stuff with var sp=document.createElement('span'); */ var a = document.createElement ('a'); a.innerHTML =...

Image onload for static images

I know that for the image onload to work you have to set the src after the onload handler was attached. However I want to attach onload handlers to images that are static in my HTML. Right now I do that in the following way (using jQquery): <img id='img1' src='picture.jpg'> $('#img1').load( function() { alert('foo'); }) .attr('src'...

Add listener for all element events in WPF

I would like to hook for all available element events in one call. Some thing like this: elem.AddHandler(AnyRoutedEvent, (RoutedEventHandler)handler) How can I do this? ...

Populate user control on event raised by another user control in the same page.

In a webpart I have two user controls loaded. I want to be able to populate one of the controls when an event is triggered in the other control, a parameter has to be passed between the controls. ...

IndexOutOfRangeException on accessing attributes through String array?

I have a treeView displayed on a winform.Now when i click on an xmlnode in the treeview its attributes get displayed in the listbox.Now i have divided the whole logic in UI and back end part. Now what i want that my back end class contains the method to display atrributes(name and value) of the xml node clicked and these are stored in an...

Calling my own event code and custom event code in c#

I have made a winforms application and in it i've implemented a custom richtextbox control. Now i'm refering it as a windows control (a dll file)in my project. In my program for the richtextbox i've written functionality inside it's textchanged event. Now i want to do some additional work which can happen only after the textchanged event...

C# How do disable a key

How do I prevent the caret to go to the next line when the 'ENTER' key has being pressed on a text-box? In other words how to disable the 'ENTER' or 'RETURN' key on a text-box? ...

Is there an onSelect event or equivalent for HTML <select> ?

I have an input form that lets me select from multiple options, and do something when the user changes the selection. Eg, <select onChange="javascript:doSomething();"> <option>A</option> <option>B</option> <option>C</option> </select> Now, doSomething() only gets triggered when the selection changes. I want to trigger doSomethi...

Determining when IE activex control has been repainted.

I was using spy++ and noticed that the IE control I have embedded in a windows form was periodically calling or sending WM_PAINT when it repaints itself. I'm trying to figure out how in C# code I can perform a C# method every time this control sends WM_PAINT. I know just enough pinvoke at this point to be dangerous. Thanks in advance,...

Is there a way to delay an event handler (say for 1 sec) in Windows Forms

I need to be able to delay the event handlers for some controls (like a button) to be fired for example after 1 sec of the actual event (click event for example) .. is this possible by the .net framework ? I use a timer and call my code from the timer's tick event as below but I am not sure if this is the best approach ! void onButtonC...

Handling key events on WebBrowser control

I am using the WebBrowser control in a C# application and want to handle all key events while the WebBrowser has the focus, regardless what individual content element (input field, link, etc.) is focused. I tried to simply add an event handler to browser controls KeyDown event, but this does not work. I don't want to explicitly hook a ...

Terminology - can events be "thrown"?

Twice this week, I've read people write that an event (.net) was "thrown". I've always thought that the verb to use with events is either "fire" or "raise". I thought that "thrown" was used for exceptions, but not events ("raise" can be used for either). Does anyone else find it confusing for events to be "thrown"? ...

Removing inline static event

I have a static event in a static method that I am temporarily attaching to, as I don't want it to hang around in memory, or get in a situation where I am firing two event handlers if I call it twice. I have little say in whether these should be static or not, and would prefer not to have the discussion / refactor responsibility. Initi...

jQuery Events params through chain

function first(a){ if (a == 'a'){ return false; } } function second(){ return 'a'; } $('.c').click(first).click(second); How to send message to other chained events? Or stop others from one? ...

AS3, hooking your events

Does anyone have experience in hooking onto events. so we can modify there behavior without changing it's initial. So lets say we want to modify the behavior of every click of a certain set of menu buttons that if you click them you would wait 30 seconds before the original callback is called. I'm working on a project that will create ...

jQuery events chain - from stack to queue

Will execute in order 'first, second'. I need last as first executed. function first(){ alert('first') } function second(){ alert('second') } $('input').click(first).click(second); ...