events

Retreive a list of Events

Is there any way to retreive a list of events of a DOM in Javascript? e.g. I register FuncA, FuncB, FuncC for the onclick event using AddEvent or AddEventListener methods. How do I get the reference of all these functions for that onclick event? Ideally, I want to have a function like this: eventList = getEvents(obj, 'onclick'); a...

Wrapping boost::function with a C++/CLI class event

I'm trying to figure out how to wrap a boost::function member (used as an event callback) of an unmanaged class with a C++/CLI class event. I do not have control over the unmanaged class. All I can do is figure out how to write the C++/CLI class properly. Here's the example unmanaged class: class X { public: boost::function<void ...

Raising external object's events in C#

If actions is a Panel, am I able to raise the Click event of it's parent? I have this code at the moment, but the Click event isn't a method, so this code is invalid. Does anyone know how I can achieve this? actions.Click += delegate(object Sender, EventArgs e) { ((Panel)Sender).Parent.Click(); } ...

UserControl's Event Handler not firing

I dynamically load a UserControl into a View that's in a MultiView control. Although the UserControl adds an event handler, the event never fires. What am I missing here? Thanks! Containing ASPX page: protected override void OnPreRender(EventArgs e) { if (MultiView1.ActiveViewIndex == 2) //If the tab is selected, load control ...

Migrating Handles from VB.NET to C#

Hi, I'm migrating some code from VB.NET to C# (3.5). I find structurs like: Public Event DataLoaded(ByVal sender As Object, ByVal e As EventArgs) Protected Sub Mag_Button_Load_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Mag_Button_Load.Click [..] RaiseEvent DataLoaded(Me, EventArgs.Empty) End Sub [..] 'Other C...

Why is it bad to make elements global variables in Javascript?

I've heard that it's no good idea to make elements global in JS. I didn't understand why. Is it something IE can't handle? For example: div = getElementById('topbar'); ...

Events or Lambdas in C#?

I'm throwing this out there just as a question of curiosity... Assuming you're only expecting/wanting one method to be provided, would this be frowned upon or bad practice? public class Something { public Action OnRemove = () => { }; public Action<object, EventArgs> OnFinishedLoading = (sender, e) => { }; } // then used like....

How can I prevent the keydown event of a form in C# from firing more than once?

According to the official documentation, the KeyDown event on a Windows Forms control occurs only once, but it is easy to demonstrate that the event fires continually aslong as a key is held down: private void textBox1_KeyDown(object sender, KeyEventArgs e) { label1.Text = string.Format("{0}", globalCounter++); } H...

ListView ItemChecked event

I have a ListView where each item has a checkbox. Initially there are no events attached and I set the state of the checkboxes programatically. After this I attach an ItemCheckedEventHandler and the event handler fires for each of the events that occurred before the handler was attached. Is there a way that I can clear the event queue...

Not getting Mouse Out Event

Hi Experts, I've this code in flex where I register a mouse out event listener - ... var b:Button = new Button(); b.addEventListener(MouseEvent.MOUSE_OUT, buttonOutHandler); ... private function buttonOutHandler(evt:MouseEvent):void { ... } Problem that I am facing is that sometimes when I move my mouse out of the display Obj...

Assigning datasource during databinding event

I've been playing around with assigning an ASP.NET WebControl's DataSource when I'm handling its DataBinding event. For general data binding logic in my pages, it seems to work well in organizing things. What arguments are there for not doing this? ...

understanding events and event handlers in C#

I understand the purpose of events, especially within the context of creating user interfaces. I think this is the prototype for creating an event. public void EventName(object sender, EventArgs e); but I don't understand event handlers, specifically what they do, why they're needed, and to create one. Could someone please enlighten m...

Zoom in/out gesture UIView

Hi, i've been trying to capture gesture zoom in/out in a UIView. Code: NSSet *allTouches = [event allTouches]; NSArray *twoTouches = [allTouches allObjects]; UITouch *first = [twoTouches objectAtIndex:0]; UITouch *second = [twoTouches objectAtIndex:1]; CGPoint firstPoint = [first locationInView:self]; CGPoint secondPoint = [second lo...

How To Make A Web User Control's Child Control's Events Cause A Catchall Event To Fire On The Parent Once Per Postback

Say that I have a web user control that has several drop down lists in it. They are all set to AutoPostBack = true, BUT each SelectedIndexChanged event handler in my control will fire/chain the other SelectedIndexChanged handlers I have defined for the other DDLs. This means that when the user changes a single DDL, the event handlers are...

C#/.NET - WinForms - Instantiate a Form without showing it

I am changing the Visibility of a Form to false during the load event AND the form still shows itself. What is the right event to tie this.Visible = false; to? I'd like to instantiate the Form1 without showing it. using System; using System.Windows.Forms; namespace TestClient { public partial class Form1 : Form { public...

UserControl events not working for first time

Hello All, I am calling my user control in a web page dynamically. For the first time when I click the button on user control, the event is not firing. When I click the same for a second time, the events are firing.. Can anyone help me? ...

How is the Observer pattern different from an Event driven model?

I am a senior level developer but I haven't had a lot of formal training and I although I have used many design patterns and seen them used in my years as a developer, no one really went out of their way to say. "Oh this is an observer pattern, or this is a Singleton pattern." Reading over some of the design patterns, I came across the ...

Swing: How to create Events and dispatch them to a component?

I need to send some events to a component in Swing, so it is handled just like any user generated, standard Swing events. Basically, something like a macro recorder, and then executor for JEditorPane. But I need more control over the generated events. SO, assume I have an editor, I want to: capture all events sent to it, and at that...

jQuery + IE Blur Firing on Mouseout

ok, so I have a popup search box that is shown when the user mouses over a hyperlink, when the user mouses out of the search box, the box disappears. this all works fine. When the textbox has focus, the search box is supposed to stay visible until the textbox loses focus, at which time the box will hide if the cursor is not over the b...

Windows forms Text Changed on leave event

Maybe I'm just an idiot, but I can't seem to find an event that will fire for a textbox at the same time as the leave, but only when the contents of the textbox has changed. Kinda like a combination of textchanged and leave. I can't use textchanged cause it fires on each keystroke. Right now I'm storing the current value of the textbo...