events

User control added dynamically to a WinForm doesn't fire its inner controls events

I have a user control which has several radiobuttons and buttons... I have code to handle button's click events and radio button's CheckedChange event. After adding this userControl dynamically to a Form panel, I notice the events of the inner controls are not firing. I'm doing a "new" of the user control, and adding it to the Controls...

JavaScript: Create event with current mouse coordinates

Hi there, I was looking on this post but it doesn't really help me. What I'm trying to do is to create event, or what would be even better, access current mouse screen coordinates. I have a function with setTimeout inside it, where number of different checks on attributes are performed. In my program some of the elements are changing p...

Code equivalent to += assignment to an event

I was wondering if anyone could tell me the raw code equivalent to the += operator for adding a method to an event. I am curious to how it it works from a technical standpoint. ...

Getting Allen Bauer's TMulticastEvent<T> working

Hi all! First Question! :) I've been mucking around with Allen Bauer's code for a generic multicast event dispatcher (see his blog posts about it here). He gives just enough code to make me want to use it, and unfortunately he hasn't posted the full source. I had a bash at getting it to work, but my assembler skills are non-existent. ...

WPF - Storyboard completed event

I'm designing a game like this class Anima { Storyboard story; Random rand; Canvas canvas; Ellipse target; public Anima() { rand = new Random(); canvas = new Canvas(); target = new Ellipse(); target.Fill = Brushes.Red; target.Width = 50; target.Height = 50; Canvas.SetLeft(target, rand.NextDouble() * 300); Canvas.S...

c# .Net CF Form.Invoke raise ArgumentException

Hello I am receving an ArgumentException from the following code, I am struggling to understand it the last entry in the stack trace is System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess,...

Manually Dispatching a DocumentEvent for testing UI element validation code

Hi. I'm testing a Swing GUI application using the UISpec4J testing framework. I'm testing validation code on a JTextField, but the framework does not support focus-change events, as it runs the application in a headless fashion. The text field has a DocumentEvent attached to it that activates the validation code. I'm trying to figure o...

Arraycollection not capturing the thrown event?

I have a collection of objects and each object throws an event every time its value gets updated. Im trying to capture that event by adding a listener to the arraycollection that holds it (see main class) but its not working. Honestly I'm not sure this is the correct approach. I'm avoiding using Collection.CHANGE because it fells into a...

iPhone Dev - Delegate or event?

In many situations, such as making the keyboard go away when the use clicks done, there are two options: set the text field's delegate to self, and adopt the UITextFieldDelegate protocol, and then use the method - (BOOL)textFieldShouldReturn:(UITextField *)textField; to resignFirstResponder and return YES. But you can also addTarget:self...

Is it possible to raise an event on an object, from outside that object, without a custom function.

public class a { public event eventhandler test; public void RaiseTest(){//fire test} } Is it possible to raise test on this class, from outside this class, without calling the method? Basically I have a large number of events which must be raised based on an external source, and do not want to create a Raise() function for eac...

WPF Binding Question

Here's the situation: Using WPF I have an object set to the DataContext of a window. A listview on this window is bound to display a list of users which corresponds to a property in the DataContext(Users). Whenever a A User is chosen I set the CurrentDisplayedUser to this user to the selected object. I have another list box that's...

Why would my child controls be uninitialized at the time of event attachment?

I have a page and a user control we'll call them Detail.aspx and Selector.ascx. Let's say the page shows the details of individual records in a database. The user control basically consists of a DropDownList control and some associated HTML. The DropDownList displays a list of other records to switch to at any time. When the DropDow...

Is there an easier way to reference the source element for an event?

I'm new to the whole JavaScript and jQuery coding but I'm currently doing this is my HTML: <a id="tog_table0" href="javascript:toggle_table('#tog_table0', '#hideable_table0');">show</a> And then I have some slightly ponderous code to tweak the element: function toggle_table(button_id, table_id) { // Find the elements we n...

What does this code do (ever seen an object without a reference variable? how about invoking the object later without the reference variable?)?

EventQueue.invokeLater(new Runnable() { public void run() { ZipTestFrame frame = new ZipTestFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }); ...

JavaScript "window.onload" – is "window" really necessary?

I see people use "window.onload" all the time, but why? Isn't the "window" part completely superfluous? ...

Attach a body onload event with JS

How do I attach a body onload event with JS in a cross browser way? As simple as this? document.body.onload = function(){ alert("LOADED!"); } ...

How do I attach the "select" event to every text node on the page? Is there a better way?

NOTE: Solved my own problem, it seems. See the edits. I am trying to write a greasemonkey script that will highlight all the matching texts on the page when the user selects a text, and then remove the highlighting when the selection is canceled. I am looking for a jQuery way to do this. It seems like there is a select event in the jQue...

how do i catch itunes events?

i have added this code iTunes.OnPlayerPlayingTrackChangedEvent += new _IiTunesEvents_OnPlayerPlayingTrackChangedEventEventHandler(iTunes_OnPlayerPlayingTrackChangedEvent); and this code private void iTunes_OnPlayerPlayingTrackChangedEvent(object iTrack) { if (iTunes.CurrentTrack != null) { if (...

What causes a ListChangedType.ItemMoved ListChange Event in a BindingList<T>?

I have a BindingList(T) that I am displaying in a DataGrid. I'm watching for ListChanged events and performing different actions when the ListChanged event is evoked. I'm checking the ListChangeType argument of the event to check how the list was changed, and then responding accordingly. However, I noticed that there is a ListChanged ev...

C#: when an event has mutiple subscribers, how do I get the return value for each subscriber?

The code looks like below: Clock: public class Clock { public event Func<DateTime, bool> SecondChange; public void Run() { for (var i = 0; i < 20; i++) { Thread.Sleep(1000); if (SecondChange != null) { //how do I get return value for each subscriber? ...