events

C# simple Event Raising - using "sender" vs. custom EventArgs

Consider this scenario. I have an object, lets call it.... Foo. Foo raises a simple event named "Loaded". As part of the information for the event, consumers will need to know which foo object raised the event. Our team has adopted the following pattern. 1) Create a new class that inherits from EventArgs - for example, FooEvent...

WPF: Is there an event that is fired when the user presses the close button [X] ?

Is there an event that is fired when the user presses the close button? This is because the Window Closing event is fired both when one closes the window manually (with the Close method) and also when the user presses the [X] button...but I somehow need to know only when the user presses the [X] button not when the window is closed manu...

Handling ObjectDisposedException and similar exceptions during the process shutdown?

My application generally running on 10-20 threads and these threads sending events to the GUI to the update certain controls almost every seconds. When the user close the application middle of these, all updates related with these events causes several random crashes. Mostly ObjectDisposedException and NullReferenceException. Since the...

JQuery URL Event Listeners

I'm trying to get JQuery to highlight an element based on the link ID selector For Example <a href="#thisid">Goto Element with ID name</a> Highlights the element below. <div id="thisid" class="isNowHighlighted">FooIsCoolButNotBetterThenBar</div> Iv tried searching for relevant plugins but no joy. Any ideas? ...

Getting Events from a Database

I am not very familiar with databases and what they offer outside of the CRUD operations. My research has led me to triggers. Basically it looks like triggers offer this type of functionality: (from Wikipedia) There are typically three triggering events that cause triggers to 'fire': INSERT event (as a new record is being inserted...

What are good ways to get something like D-Bus to work across multiple Linux machines, possibly through firewalls?

The D-Bus specification says that D-Bus is.. a simple way for applications to talk to one another... Currently the communicating applications are on one computer... I would like something like D-Bus but to work across multiple Linux machines, and there may be firewalls involved. For example, if my mail server decides it receives a...

WPF: Routed events or regular events?

In WPF we have routed events. When should these be used instead of regular events? ...

How to use something other than the DefaultClosingOperation when closing a JFrame window?

Hi, I am working on a chat client using a socket, and I want a certain code to be executed before the window closes when the user clicks on "X" (like closing the connection properly). Can I do that without having to implement all the abstract methods in WindowListener? /Avin ...

Raise button (or any control) click event manually. C#

Can anyone tell me how to raise click event of button control (or for that matter for any event). Platform: .net 2.0/3.0/3.5 Language: c# Domain: Windows Application, WinForms, etc. ...

Avoid duplicate event subscriptions in C#

How would you suggest the best way of avoiding duplicate event subscriptions? if this line of code executes in two places, the event will get ran twice. I'm trying to avoid 3rd party events from subscribing twice. theOBject.TheEvent += RunMyCode; In my delegate setter, I can effectively run this ... theOBject.TheEvent -= RunMyCode; t...

Key down event affected by buttons

Hi everybody, I'm new around here and i have a little problems with a C# application. I want to capture the key down event. This wasn't a problem at first but after i added some buttons to the form, the key down event of the form ignores the arrow keys and moves the focus from one button to the next.(The key up event works) Is there a w...

Generating a list of events in a Delphi/BCB Project.

I would like to generate a list of events and methods assigned to them in a given BCB project. Is there a way to do this? ...

Javascript OnMouseOver and Out disable/re-enable item problem

I wanted to have some radio buttons that disabled when the mouse went over and enabled again when it went out (just for fun). <form> <input type="radio" name="rigged" onMouseOver="this.disabled=true" onMouseOut="this.disabled=false"> </form> When the mouse goes on it it does what it should be when it goes back off the button wont re-e...

Why I could not add mousemove event after mousedown in prototype?

I would move my former js codes to more OOP style. Here's the code. function addEvent( obj, type, fn ) { if ( obj.attachEvent ) { obj['e'+type+fn] = fn; obj[type+fn] = function(){obj['e'+type+fn]( window.event );} obj.attachEvent( 'on'+type, obj[type+fn] ); } else obj.addEventListener( type, fn, false ); } function ...

Is there a standard resource for the "default action" of HTML elements?

I'm wondering if there is a defined standard for what the default action is of various HTML elements. I've looked at the W3C's HTML specification and while they are very precise with what attributes can be used with elements (and also some behavioural stuff such as exactly what gets included with form submission) there's nothing about t...

GWT: How to suppress hyperlink so that it doesn't change my history token

Hi, I want to make my hyperlinks act like buttons (only respond to Click event) however, they change the history token automatically when you click on them, which messes up my history mechanism in my application. Is there a way to suppress the default behaviour of the hyperlink so it doesn't change the history token? I tried setting tar...

Is there a way to detect closing page by javascript?

I watched a few threads here,mostly used this: window.onbeforeunload = function (e) { var e = e || window.event; //IE & Firefox if (e) { e.returnValue = 'Are you sure?'; } // For Safari return 'Are you sure?'; }; but seems this will mix the situation of refreshing page and close page, is there any possibility to distinguis...

How do I detect changes to the document in a WebBrowser control in Edit mode, using VB6 ?

We are building a HTML edit control using a VB6 wrapper around the WebBrowser control and MSHTM documents. We are having problems detecting if the document has been modified by the user. VB6 does not support using the IHTMLChangeSing and IHTMLChangeLog interfaces so these seem to be non-starters. What other events from either the WebB...

Can Visual Studio Test projects cope with events and delegates?

I am working on new functionality for a large C# project which is mostly legacy code. The area that I'm working on handles XML schema messages, creates a schedule for their transmission and places them into some legacy timer code which notifies me when they should be sent. Although I am new to them, Visual Studio test projects are provi...

asp.net:i want to change color of dynamically generated linkbutton on mouse cursor focus with javascript .

code: LinkButton linkButton = new LinkButton(); linkButton.OnClientClick="changecolor";--i need to change this to on mouse focus event there is no property for for link button like we have onClientClick. ...