events

How can I determine which menu item called an ActionListener?

I have a Java program where I have a JMenu with an arbitrary number of items (in this case, there is one menu item for each dynamic library currently loaded in a different program). I'm running a loop to add JCheckBoxMenuItem s to the menu, since I don't know how many there will be. How can I set up an action listener for these menu ite...

Javascript event that fires without user interaction?

A textbox on my form may change depending on what's selected in various drop down lists. Is there a way to call a javascript function when the textbox value changes? Tried onchange event but this only seems to work if a user manually changes the textbox value. Cheers, Breandán ...

Silverlight: Threads / Delayed Actions / Asynchronous invocations/events

Hi, I've got the following scenario: when a user moves the mouse out of a popup, I want an animation to happen, and five seconds later, I want to remove a PopUp. This is the code I expected to do this with is: private bool leftPopup = false; public void AnimatePopupOut(object sender, MouseEventArgs e) { myAnim.Begin(); (new Thre...

Flex and fake Mxml initialisation without actually showing the component, (more insise)

Hello, I have a TitleWindow mxml class wich has several components, and listeners. On its creationComplete and init state i add some listeners which listen for events on its gui. This TitleWindow is only shown when the user click on a "button", i made TitleWindow a singleton with the following code: public static function getInstanc...

Why can't I connect to my COM objects events after creation?

I have written a COM object using C++. Creating the object and connecting to its events works fine if I do them both at the same time (Javascript): var obj = WScript.CreateObject("SomeCOMClass.Object", "event_"); However the following generates this error (msdn): http://msdn.microsoft.com/en-us/library/a7tya2wc(VS.85).aspx. var obj ...

SharePoint: Error on unregistering an EventReceiver form a ContentType

Hi, I've got some problems unregistering some eventreceivers form a contenttype. The contenttype and the receivers were deployed and registered by myself so I don't try to remove any MOSS built-in or internal eventreceivers. I trying to archive this with the following code snippet: using (SPSite site = new SPSite("http://wssdev06/"))...

How do I remove an event listener from an anonymous component?

Say I have an event listener tied to a component and I want to remove the event listener from the component so it can be garbage collected. The problem is I don't know what kind of object it is or what event listeners it has. Basically how can I find out what event listeners an object has and how can I remove one or all of them? ...

C# app.config format issue

Hello everyone, If the app.config format is wrong, for example, not a correct format XML file, application will fail from loading. Are there any ways to let me know such issue -- for example, receiving some events (so that I could write file log and event log to record this issue) if app.config loads error because of a mal-formatted XML...

C# _Click Event Casting Sender and Using FindControl

I have a _Click event that is firing when a chart is clicked on. In this event I immediately cast the sender to type Chart. I often follow this paradigm but feel icky each time that I do. In this particular instance I am also immediately running out to find a corresponding UpdatePanel so I can add a dynamically rendered GridView to it...

javascript/jQuery: event fired twice

I'm trying some event bindings with jQuery and I have this simple code in my document ready: $(document).ready(function() { $("p a").each(function(i, selected){ $(selected).hover( function(event) { alert('over: ' + event.type); }, function(event) { alert('out: ' + event.type); }); } ) }); So, when I move mou...

Windows API "Chess Timer" Sepmaphore Event

Is there a semaphone that works like a Chess timer, meaning; Thread A completes its task, loops back up to the top and calls the Semaphore This triggers Thread 2 which proceeds through its code, loops back up to the top and calls the Semaphore This triggers Thread A which... So the Semaphore is both blocking and signaling. I know I ...

problem with gridview method calling

Hi, Though i am setting in grid view OnRowDeleting="GridView1_RowDeleting" and cicking on the gridview i am getting the protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) as i am clicking on Delete link it should open the Delete Event protected void GridView1_RowDeleting(object sender,GridViewDeletedEve...

Creating/Opening Events in C++ and checking if they are fired

I have two threads that use an event for synchronization. In each thread they use the same call: ::CreateEvent( NULL,TRUE,FALSE,tcEventName ) The producer thread is the one that makes the call first, while the consumer thread makes the call last, so it's technically opening, not creating the event... I assume. But, when SetEvent is c...

Winforms generated events and removing the handlers

When creating form windows, often there are situations where a particular event was added and the program comipled.However later u realize that the event is not really required and so remove the event. Now when u compile the code again an error is displayed. For example in the code I have written: WindowsAplication1.LanMessenger does not...

How to display treenodes by binding nodes in the treeview to nodes of the XML document.

Hi, I have a Treeview where on selecting a node the attributes and values has to be displayed in listbox. In treeView1_AfterSelect, the text parsing code depends on the textual representation for a node in the tree view, which can be changed at any time and break the entire logic of list display. This strong dependency between the tree v...

Can you do this using jquery?

Is it possible to do this from within a class? $("#" + field).click(this.validate); So basically I want to pass a function of the object that should be executed whenever something is clicked. Also, if there are more than 1 instances of this object, then the correct instance (i.e the one which runs this code for the given field) sho...

Handlers overwriting Cancel property on CancelEventArgs

CancelEventArgs provides a Property called Cancel that different event handlers can set to tell the object that invoked the event whether it should continue execution cancel the action. It seems that since events are multicast delegates, a simple raise of the event might invoke two delegates. The first one sets the Cancel property to tr...

Global keyboard capture in C# application

I want to capture a keyboard shortcut in my application and trigger a dialog to appear if the user presses a keyboard combo even outside of the app. Similar to Google Desktop Search's Ctrl, Ctrl to bring up the search dialog. I have tried using some keyboard hook modules out there that basically use Win32 interop to get this effect but ...

How to do Events in Ruby?

I come from a C# background, and have just started programming in Ruby. The thing is, that I need to know how I can raise events in my classes so that various observers can be triggered when things need to happen. The problem is the books I have on Ruby don't even mention events, let alone provide examples. Is anyone able to help me? ...

Flash: .as vs .fla - loaderInfo.loader

I have this code that works from an .as file if (loaderInfo.loader) loaderInfo.loader.dispatchEvent(new Event("pageFinish", true)); Then I put the above code into an .fla file (another existing Flash file), but (loaderInfo.loader) always returns false, eventhough it is loaded from another swf. Hence the event is never dispatched. Ed...