events

Flash: Dispatching/handling events

Hi, I have Flash application (main_container.swf) that loads another swf file (page1.swf). I want to dispatch an event when page1 has finished, to tell the main_container to close page1. Is this how you dispatch an event from page1 to the main_container? parent.dispatchEvent(new Event("pageFinish", true)); Then how do you catch the...

How to put an event in dynamic creation on flex?

Please help. I want to add a click event on checkbox that i created dynamically so that i know what checkbox I click. Heres my code on action script: var myCheckbox:CheckBox = new CheckBox(); vbox.addChild(myCheckbox); How to add click event on checkbox? ...

Which Delphi component contains the most events?

I was writing some code a few days ago based on Hallvard's Hack #10, and it made me wonder, how many events tend to get put on things? So far, the highest count I've found comes from an in-house custom descendant of a DevExpress grid at the company I work for, which has 83 published events in the Object Inspector. Anyone know a compone...

Unsubscribe to child object prop changed events

Say I have a object Client that has a child StatusType object. Both implement INotifyPropertyChanged. The Client subscribes to the prop changed event in the property after checking for null and making sure value is different public StatusType Status { get { return _status ?? (_status = this.GetNewStatusType()); } set { ...

How do I get the subscribers of an event?

I need to copy the subscribers of one event to another event. Can I get the subscribers of an event (like MyEvent[0] returning a delegate)? If this is not possible I would use the add accessor to add the delegates to a list. Would that be the best solution? ...

How to get touch event on a CALayer?

ok - I'm new to the iPhone SDK. Right now I'm programming with CALayers which I really like a lot- not as expensive as UIViews, and a lot less code than OpenGL ES sprites. I have this question- is it possible to get a touch event on a CALayer? I understand how to get a touch event on a UIView with -(void)touchesBegan:(NSSet *)touches...

managing parent frame from child frame on java swing

I have a jframe (parent) which creates an input frame (child) where I get some parameter. In the "child" frame I have "ok" and "cancel" buttons. When "ok" button is pressed, the parent frame needs to be updated with new data. What is the best way to do that?? ...

Handling selection of shapes on a board (algo)

I have a board as a canvas with several shapes drawn on it, some of them are triangles, circles, rectangles but all are contained inside their own bound delimited rectangle. "The circle will be inside a rectangle" I put two circles A, B on the board where A is over B and has some area colliding. If I click on A area corresponding to th...

How to impement an event which can be canceled?

Help me please to implement an event, which handler can cancel it. public class BuildStartEventArgs : EventArgs { public bool Cancel { get; set; } } class Foo { public event EventHandler<BuildStartEventArgs> BuildStart; private void Bar() { // build started OnBuildStart(new BuildStartEventArgs()); // how...

When the user presses "Enter" in a ToolStripTextBox (VB.NET)

I have a ToolStripTextBox (the name of it is SearchBox) and I would like it when after the user types something and presses enter it takes them to a URL. I've got the URL part sorted out, but I need to know what goes after Handles SearchBox.{what?} I don't see any event in the intellisense popup for something when the user presses "en...

Can I redirect events in .NET?

I've got a class which is catching the System.Diagnostics.DataReceivedEventArgs event. I want to make this event externally available. To accomplish that currently I'm catching this internally and raising another event, which seems like a bit duplication to me. What's the best way to this? Can I wire these events so I do not need to ...

Datalist placed inside a usercontol problem

Hi,I have a usercontrol.Inside usercontrol I have a datalist and sqldatasource.Sqldatasource needs a parameter to databind the datalist.Usercontrol gets a paramter by this way, private string _urunIDparam; public string urunIDparam { get { return _urunIDparam; } set {_urunIDparam = value; } } And then thi...

C# .NET 3.5 : How to invoke an event handler and wait for it to complete

I have a class containing a worker thread which receives data from a queue in a loop. Another part of the app sinks an event from this class, which the class raises for each queue item. These events are fired asynchronously, so at busy times the other part of the app can be processing several events at once. This should be fine but we...

How do I give an ASP.Net custom control a new custom event

I feel like this is something that Google should be able to solve for me just fine, but I'm finding little to no examples that I really understand. I have this custom control called UserControlTask. I wish to add an OnHide event to it and as the name implies, I want it to be thrown when the user control is being hidden. I seem to ...

How do I deregister an anonymous handler?

C# 2.0 has a neat feature called anonymous functions. This is intended to be used mostly with events: Button.Click += delegate(System.Object o, System.EventArgs e) { System.Windows.Forms.MessageBox.Show("Click!"); }; Now, suppose that Button is a static member, then adding delegates to it would count as unmanaged r...

C# Event Subscription

In C# what is the advantage of public class blah { public event EventHandler Blahevent; } versus public class blah { private event EventHandler blahevent; public event EventHandler Blahevent { add { blahevent+=value; } remove ...

How to prevent ENTER keypress to submit a web form?

I just want to know how to prevent a 'ENTER' key pressed to submit a form in a web based application. I need a detailed answer. ...

DOM initMouseEvent clientX, clientY

Hi, how can simulate an onclick event on a DIV passing only X,Y coordinates??? If I try to make that obviously the dispatchEvent function wants the object on which the event will be raised...but then what is the meaning of passing in event creation the coordinates???? Thanks ...

problem with button

I am using a jquery click function: Button code: <input type="button" id="myButtton"> Jquery code: $(document).ready(function(){ $("#myButtton").click(function(){ alert("Mybutton"); }); This code works in Internet Explorer but does not work in Firefox. What am I doing wrong? ...

How can page events be handled from a usercontrol? (VB.net)

I would like some code to execute at the "preload" stage of my usercontrol's lifecycle. However the preload event is only available on the Page object. So, I added the following method to my usercontrol: Private Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Page.PreLoad However, I know get the compile...