event-handling

Android: Event handlers for a custom view? (QUESTION REVISED)

OLD QUESTION (Already answered by Mark - The answer is to use getTag()): Let's say I have a ListView with a custom layout for each row having an ImageView and a TextView. Now, when a click is made, I am able to determine which image and which textview were clicked based on the view but if I have to pass this information to say another ...

NotifyIcon Events not firing

Hi everyone! I'm new here and have a really mysterious problem to start off. I'm a software developer in the UK and have over 15 years of experience but have only been developing in .Net for 18 months. My NotifyIcon mouse events are not firing! I am using C# to write an application that starts as a NotifyIcon ('main app icon') and disp...

VB.NET overload default functionality when user clicks the X (Close Program)

How do I go about overriding the default functionality when a user clicks the X in a VB.NET form-based application? I am currently handling the MyBase.Closing event... but since it's a DirectX app, I need to do some cleanup before allowing the form the close. Thanks ...

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...

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...

Fire WPF DataGrid edit from child element

You can refer to this question for background/explanation of what the context to my problem is. Basically, I have a WPF DataGrid bound to an ObservableCollection of an IEditableObject object. In a custom DataTemplate, for one of my columns that involves a flag enum property, I have constructed an Expander whose content is a bunch of che...

Events/Delegates In Java or C#

I've been trying to learn about events/delegates, but am confused about the relationship between the two. I know that delegates allow you to invoke different functions without needing to know what particular function is being invoked. (eg: a graphing function needs to accept inputs that are different functions to be graphed). But I don...

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...

Javascript custom "event" listener, using prototype implementation OOP

I have been trying to wrap my head around this one, and a lot of tutorials and sites have been suggesting the creation of a separate event object, which seems to be a bit of overkill for just implementing one function to happen at some point in the object. Basically I want to have a custom "onComplete" event to fire when certain methods...

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...

Javascript: attaching OOP methods to events and the 'this' keyword

I am new to OOP Javascript and am having trouble with the this keyword and events. What I'm trying to achieve is: I have multiple DOM objects and want to not only bind a common event to them, but keep some data about the aforementioned objects in a global container (to increase runtime performance). So what I do is basically this: f...

How can I preserve the page scroll position when opening a dialog in response to a link trigger?

I would like to know how I can maintain the scroll position when I open a jQuery dialog. Here is the code I'm using to open my dialog: <a class="link" onclick="openmyDialog();" href="#">Open a dialog</a> And the function : function openmyDialog() { $("#dialog").dialog('destroy'); $("#dialog").html("msg"); $("#dialog").di...

Efficiently handling timed events in a server

In my case I've got a game server, with the CLR threadpool handling the sockets, and a managed threadpool for the other stuff. I'm trying to figure out what the best way to handle events like, an npc casting a spell, or despawning after a set period is. I could just write some sort of Timer wrapper that gets a new (managed)threadpool t...

How to get the mouse button state in Silverlight outside of button press events?

I have the following situation I handle when the left mouse button is pressed in my Silverlight app and do some things while the mouse is held down and the mouse moves. When the left button is released, I turn off the flag that's telling it to do the stuff and the mouse movement handler then no longer does the stuff. The problem is: if...

addEventListener() attached to multiple buttons, but only fires once

I am writing a Facebook app in PHP/FBJS. I have some code where I attach an addEventListener() to two buttons. When I run the app, the first button I click on fires the addEventListener() and the event handler is invoked as expected. But if I click on the second button or click on the same button again, the event handler is not invoked. ...

JQuery mouse events with stacked elements

I have a web page with a table. Using jQuery 1.3.2, I absolutely position a div element over the top of each row on the table. The overlaying div has a higher z-index. I attach 'mouseenter' and 'mouseleave' events to the overlaying div element. On mouseenter, I throw a red border around the overlaying div. On mouseleave, I remove the bo...

jquery click handler

I create a bunch of tags dynamically, appending them to a I then add a click handler... $(document).ready(function(){ // ... code to append <a> tags to nav div $("#nav a").click(function(event){ alert('Clicked '+event.target.id); return false; }); }); If I have 10 tags as a result of this and clic...

ASP.NET ImageButton Onclick Event not handled

I have an ImageButton in a GridView. <asp:GridView ID="ItemGridView" runat="server" DataKeyNames="Id" OnRowDataBound="ItemGridView_RowDataBound" AllowPaging="True" AllowSorting="True" EnableSortingAndPagingCallbacks="True" AutoGenerateEditButton="False" AutoGenerateDeleteButton="false" DataSourceID="ItemDataSource...

Android: Is it possible to observe system calls?

I was wondering if there is a way to observe the system calls in Android using a service... Is something like this remotely possible using Java or do I have to get down into native code...? Thanks ...

JQuery click function not being set

I want my links not to have the weird outline and the best way I found to solve this is have a "null link" to focus on after a click. This works great when defining the onclick method inline the HTML but that is not ideal. I wrote a quick jQuery snippet to do this instead, but I am having trouble getting it to work. Here it is: <scri...