events

C# Calling a Method in Containing Class

I have a page with 2 web controls that intentionally have no knowledge of each other. Each control also has its own helper class to take care of events and such. Only 1 of the controls (EditBox) has a "save" button on it and when it saves, it needs to grab data from the other control (MceEditorAlpha) on the page, how do I do this? The Mc...

JS and Prototype : mouseover influencing overlying element, why?

I try to create a mouseover Event on a div wich containt a link. When the mouse pass over the div the background is apply to all div correctly, but when the mouse is over the link the background get apply only to the link, why? The link IS in the div, so logically it should still call my event on the div. ----------------------------...

IE doesn't run Javascript when you click 'back' button

I've built a shop with tons of JS running. One of the pieces of the cart, is a zip code field which is required to calculate shipping cost. This works fine going through the cart. Now clicking checkout takes you to paypal. If you click back, in IE the setup scripts (like clear the zip field) aren't fired. They work in Safari & FF, but ...

WPF Animation Completed Event in ControlTemplate

In my WPF application, I have the standard Generic.xaml file, which contains a style for my custom class, Frost. I need to find a way to hook up the Completed event of one of the animations to my custom Frost class, I cannot do it at runtime because it complains at me that i need to set IsFrozen to false which I do not want to do (becau...

C# Events without arguments. How do I handle them?

I'm currently working on a menu system for a game and I have the standard hierarchy for screens and screen elements. (Screens contain some collection of screen elements). I'd like screen elements to send an event to the screen class to declare that it's been selected. However, I don't need any event arguments in this case. I'm not sure w...

WPF ListBox getting item datacontext OnMouseOver

I currently have a view that contains a ListBox bound to a a collection of view models and a user control that I would like to bind to the current item that the mouse is over. How can I get the current highlighted item in the list and bind it to the user control using only XAML and code in the View Model? Edit: The following image migh...

Can I call jquery click() to follow an <a> link if I haven't bound an event handler to it with bind or click already?

I have a timer in my javascript which needs to emulate clicking a link to go to another page once the time elapses. To do this I'm using jquery's click() function. I have used $().trigger() and window.location also, and I can make it work as intended with all three. I've observed some weird behavior with click() and I'm trying to unders...

C# Custom Events with Overloads

So I have a custom event like this: Work w = new worker() w.newStatus += new worker.status(addStatus); w.doWork(); void addStatus(string status) { MessageBox.Show(status); } and this: public event status newStatus; public delegate void status(string status); public void doWork() { ...

Handling events fired in constructors

Work = New ExampleWork() Here the Work is a withevents variable and I've used the handles clause for handling various events fired by the ExampleWork object. However the event handler will not get assigned till the constructor of the ExampleWork returns. Now how can I handle any events fired from the constructor? I can move the constru...

How can i do this with the C# 'new Process' object.

Hi folks, I wish to pass some data to the delegate method, of a Process object, when it fires the Exited event --- i'm not sure how. I've got some code (in a windows service) that is going to take a while .. so i'm forking off a new process to do it .. like ... string recipientEmail = "[email protected]"; var commandProcess = new P...

Binding event without eventhandler..why it works?

Hi, I simply do not understand why both works: this.timer.Tick += new EventHandler(timer_Tick); this.timer.Tick += classA.Tick; Thanks ...

HTML text input event

I have a form, and want to disable/enable its submit button depending on whether the form's input text fields are empty or have had text entered into them. I think this means having an event handler for the input text fields' keydown or keypress events: when it's fired, this event handler should test whether the input text fields contai...

OnClick event firing speed for components

I was using two TButton components on a form that functioned as Plus and Minus. When clicked they would add or subtract from an integer which would then be displayed on a TLabel. This functioned as desired where the speed at which I would click would fire the OnClick event without fault. I have replaced the buttons with PNGButton comp...

Is there a way to put an assertion on an event?

Can I test the assertion that an event was fired? Something like this: [TestMethod] public void EventFiresWhenChangingProperty() { var sut = new SystemUnderTest(); var eventRegister = new EventRegister(sut.PropertyChanged); sut.AnyProperty = "new value"; Assert.EventWasFired(eventRegister); } Of course I could create a...

Is there any way to clear subscription to an event in VB.NET?

In C#, I took the habit on clearing every subscriptions to my custom events in Dispose() to avoid memory leaks of subscribers forgetting to unsubscribe from my events. It was very simple to do, simply by calling MyEvent = null since the C# compiler automatically generates a delegate field. Unfortunately in VB.NET, there seems to be no s...

registering event listeners in a controller

I'm working on creating a simple MCV application, in order to understand MVC better. The problem I'm having is registering event listeners. The way I see MVC is that the view dispatches events, the controller listens for these events and acts on them, either updating the model or amending the view. So in my MVC app I have a controller wh...

What is the correct way to bind events in jQuery?

For example in php I have a list of clients: foreach($clients as $client) echo '<li id="client_'.$client->id.'">' . $client->name . '</li>'; What is the correct way to bind a click event to each list item w/o using onclick="my_function(the_elements_id)" right in the list item. ...

C# - get event from SetWindowText

We are writing a plugin for an existing VB6 application (via COM interop), and we are requiring some functionality that they do not support. We could easily get the required functionality if we could somehow receive an event for when a particular control's text on their window changes. We can already grab their existing window handle o...

Passing along information on a FileReference Complete event.

I need to pass along a string with my FileReference, or provide that string as an argument when an event fires. To be clear, it really annoys me that AS3 doesn't allow you to pass parameters on events. Right now, I've extended the FileReference class to include an additional variable. I'm trying to get this to compile, but it won't comp...

Javascript: Trigger an event that happens in a few seconds, but be able to cancel that event if another event happens?

Disclaimer: I am anything but a Javascript expert, so I'm not even sure if I'm approaching this correctly... I want to be able to trigger an event in Javascript, but be able to cancel that event if another event occurs. So, what I'm looking to accomplish is: User begins typing in a text box. When textbox contents change, trigger an ...