events

Convert vb.net event with multiple event arguements to c#

I'm in the process of transplanting a unit test written in vb.net to the larger project written in c#. However, this little ditty has me looking for help. Public Sub object_DataChange(ByVal TransactionID As Integer, ByVal NumItems As Integer, _ ByRef ClientHandles As System.Array, ByRef ItemValues As System.Arra...

Detect Mouse leave stage while dragging in Actionscript 3

Event.MOUSE_LEAVE is great in Actionscript 3, but it doesn't seem to fire if the user is holding their left (or right for that matter) mouse button down. Is there a way to detect if the mouse leaves the Flash movie while the mouse is held down? Or if it is released outside the flash movie? ...

Do custom Event type identifiers in as3 need to be unique?

Say I have two classes which extend Event: public class CustomEventOne extends Event { public static const EVENT_TYPE_ONE:String = "click"; //... rest of custom event and public class CustomEventTwo extends Event { public static const EVENT_TYPE_TWO:String = "click"; //... rest of custom event Is it ok that they...

Do Events break Interfaces?

Note: in this question, I am talking about formal Interfaces (e.g. public interface IButton {...} ). I'm an Actionscript developer, but I suspect my question will resonate in many languages that allow both formal Interfaces and Events. I love Interfaces. I love the separation between interface and implementation. (I wish Actionscript...

Why is FBJS dropping my 'onclick' attribute from this input element?

When I include an 'onClick' attribute in setInnerXTHML() like this: var innerHtml = '<span>Build Track: Select a city where track building should begin'+ '<div id="action-end">'+ '<form>'+ '<input type="button" value="End Track Building" id="next-phase" onClick="moveTrainAuto();" />'+ ...

A general delegate type for handling any event.

Hey, I have a function that receives two parameters - an object, and an EventInfo structure defining an event on that object. I need to block that function until the specified event fires. The problem I have is, how do I add a delegate to the specified event, when the type of handler could be anything? Note that I don't care about the ...

asp.net - Button event does not fire up

Hi, I have a search button on my page that runs a query on a DB, pulls out and displays some entries in a table, and for each entry I create a button. It looks something like this: List<Friend> friends = SearchFriend(searchStr); foreach (Friend f in friends) { TableCell addCell = new TableCell(), nameCell = new TableCell(); ad...

How to get the name of an Event from a handle

I have an array of Win32 event handles that I'm waiting on using WaitForMultipleObjects(). This returns the index in the array of events that triggered but what I need to know is the name of the event. I've been looking through MSDN and can't see anything to do this. Basically I have a class that monitors the registry through events u...

Is there a way to attach an event in a XAML style?

I want every clickable TreeViewItem to execute TreeViewItem_MouseLeftButtonDown, is there a way to put this in the style so I don't have to define it everywhere. I could run through all children in code behind but I would think there would be an easier way to do it in a style. The following code gives me: Cannot find the Style Prope...

Google Maps v3, polyline mouse events

Is it possible to detect when the mouse has entered and exited a polyline region in Google Maps v3? As a particular use-case, I would like to change the color of a polyline when then mouse is hovering over it. Polylines allow registration of a "mousemove" event, but it doesn't seem to allow notification of mouse over/out events. This s...

How do I force a Visual Basic 2008 function to only be accessed via events?

I want some event handling functions to only be able to be accessed via raised events and not called from the program. Such as: Public Event Event1(Byval TheText as string) private sub Event1Handler(Byval TheText as string) handles me.Event1 msgbox("Hi") end sub I want this code to execute the function:RaiseEvent Event1("Hi") But...

User event subscription in the Web app

We are developing the Web App that will have user subscription to a specific group of events. For example: User create a comment in the blob and all users subscribed to this blog should have this event in their list. Currenly, we are searching for the data model to store this data. Store all events in one table seems a good idea from t...

Force a mouse event in Silverlight 3

I have 2 UserControls: uc1 and uc2 On uc1.MouseOver, uc2 increases in size. On uc1.MouseLeave, uc2 returns to the original size. On uc1.MouseLeftButtonUp, a popup is opened. However, when the popup is then closed, uc1.MouseLeave is not triggered, so uc2 doesn't return to it's original size. A solution would be to have uc2 also subscr...

Responding to a WPF Click Event in a Data-bound User Control...

I hope this makes sense. I have created several WPF User Controls. The lowest level item is 'PostItNote.xaml'. Next, I have a 'NotesGroup.xaml' file that has an ItemsControl bound to a List of PostItNotes. Above that, I have a 'ProgrammerControl.xaml' file. Each ProgrammerControl has a grid with four different NotesGroup user contro...

FormView_Load being overwritten C# ASP.NET

I've got a formview whose load event just decided to stop working. I did some debugging and noticed that it was reaching the code, but for whatever reason, the attributes that I am adding in the load event are no longer displaying on the screen. It's as if something is happening after the formview's load event that is reloading it with...

How to make Action<param,param2> compatible with event's delegate type?

Given the code below: void LookupBox_Load(object sender, EventArgs e) { Action d = delegate { if (!_p.AutoClose) CloseLookupBox(); }; if (this.ParentForm.MdiParent != null) this.ParentForm.MdiParent.Deactivate += delegate { d(); }; else this.ParentForm.Deactivate +...

Observe event created through an instance of a Winforms UserControl

Hi! In my winforms app, I have a UserControl that contains a DataGridView. I instantiate and load this UserControl when needed into a panel in my Main Form (frmMain). My problem is figuring out how to resond to or listen for events raised in my UC's DataGridView. For example, I want to handle the CellDoubleClick event of the DataGridV...

jQuery: preventing event from executing for duration of animation

OK, I've checked this thread: http://stackoverflow.com/questions/1012447/prevent-click-event-in-jquery-triggering-multiple-times and attempted to unbind/re-bind an event as described but to no avail. I basically have a slider gallery, with a next/prev button. I want to prevent the next button from being clicked for the duration of th...

Handling a VB6 event in C# - why does it only work sometimes?

I have a VB6 application implemented as an ActiveX exe. I also have a C# application that interacts with the VB6 app via COM. This all works fine except in one scenario. If the VB6 app is kicked off from the C# app, everything is fine. If, however, the VB6 app is already running stand-alone, then although the COM interface still works...

Event Sender Gets Disposed In Client's Event Handler Code

Hello, I'm facing the following situation (C#/.Net here, but I think it's a general problem): Some of our object types (which are collections) are disposable types (IDisposable in C#, which allows clients to explicitly tell an object 'you are not needed anymore, free all of your resources') These collections fire events ('oh my, look,...