events

Javascript keyboard events primer? (or rather: help me with my custom dropdown)

I need help finishing my custom built ajax [div] based dynamic dropdown. Basically, I have an [input] box which; onkeyup, runs an Ajax search which returns a bunch of results in divs and are drawn back in using innerHTML. These divs all have highlights onmouseover so, a typical successfull search yields the following structure (pardon ...

How do I make event callbacks into my win forms thread safe?

When you subscribe to an event on an object from within a form, you are essentially handing over control of your callback method to the event source. You have no idea whether that event source will choose to trigger the event on a different thread. The problem is that when the callback is invoked, you cannot assume that you can make upd...

ABAP Column Tree Model doesn't expand node after EXPAND_NO_CHILDREN event

I am displaying a list of items using a SAP ABAP column tree model, basically a tree of folder and files, with columns. I want to load the sub-nodes of folders dynamically, so I'm using the EXPAND_NO_CHILDREN event which is firing correctly. Unfortunately, after I add the new nodes and items to the tree, the folder is automatically colla...

Capture MouseDown event for .NET TextBox

Is there any way to capture the MouseDown even from the .NET 2.0 TextBox control? I know the inherited Control class has the event, but it's not exposed in TextBox. Is there a way to override the event handler? I also tried the OpenNETCF TextBox2 control which does have the MouseDown event exposed, but no matter what I do, it doesn't fi...

Weird event behavior in IE7

I'm having trouble with events in Internet Explorer 7 When I have a form with TWO+ input[type=text] and I press Enter key the events occurs in this order: submit button, onClick form, onSubmit Sample code: <FORM onSubmit="{alert('form::onSubmit'); return false;}"> <INPUT TYPE="text"> <INPUT TYPE="text"> <INPUT TYPE="submit" onCl...

Cocoa - best way to capture key events in NSTextView?

Well? I'm slowly learning Objective-C and Cocoa, and the only way I see so far to capture key events in Text Views is to use delegation, but I'm having trouble finding useful documentation and examples on how to implement such a solution. Can anyone point me in the right direction or supply some first-hand help? Thanks in advance! ...

Windows Forms Threading and Events - ListBox updates promptly but progressbar experiences huge delay

Our team is creating a new recruitment workflow system to replace an old one. I have been tasked with migrating the old data into the new schema. I have decided to do this by creating a small Windows Forms project as the schema are radically different and straight TSQL scripts are not an adequate solution. The main sealed class 'ImportC...

Prevent a TreeView from firing events in VB6?

In some VB6 code, I have a handler for a TreeView's Collapse event: Private Sub MyTree_Collapse(ByVal Node as MSComCtlLib.Node) This is called whenever a node in the tree is collapsed, whether by the user or programmatically. As it turns out, through some roundabout execution, it may happen that this handler will wind up telling a no...

Listen for events in another application.

Suppose I have two applications written in C#. The first is a third party application that raises an event called "OnEmailSent". The second is a custom app that I've written that I would like to somehow subscribe to the "OnEmailSent" even of the first application. Is there any way that I could somehow attach the second application to a...

Calling base Methods When Overriding Page Level Events

In my code behind I wire up my events like so: protected override void OnInit(EventArgs e) { base.OnInit(e); btnUpdateUser.Click += btnUpateUserClick; } I've done it this way because that's what I've seen in examples. Does the base.OnInit() method need to be called? Will it be implicitly be called? Is it better to call it at t...

Cleanest Way to Invoke Cross-Thread Events

I find that the .NET event model is such that I'll often be raising an event on one thread and listening for it on another thread. I was wondering what the cleanest way to marshal an event from a background thread onto my UI thread is. Based on the community suggestions, I've used this: // earlier in the code mCoolObject.CoolEvent+= ...

C# Event handlers

In C#, what is the difference (if any) between these two lines of code? tmrMain.Elapsed += new ElapsedEventHandler(tmrMain_Tick); and tmrMain.Elapsed += tmrMain_Tick; Both appear to work exactly the same. Does C# just assume you mean the former when you type the latter? ...

What is the difference between a delegate and events?

What is the difference between a delegate and an event? Don't both hold references to functions to be executed? ...

DoDragDrop and MouseUp

Is there an easy way to ensure that after a drag-and-drop fails to complete, the MouseUp event isn't eaten up and ignored by the framework? I have found a blog post describing one mechanism, but it involves a good deal of manual bookkeeping, including status flags, MouseMove events, manual "mouse leave" checking, etc. all of which I wou...

How to Maintain Correct Javascript Event After Using cloneNode(true)

I have a form element that contains multiple lines of inputs. Think of each line as attributes of a new object that I want to create in my web application. And, I want to be able to create multiple new objects in one HTTP POST. I'm using Javascript's built-in cloneNode(true) method to clone each line. The problem is that each input-lin...

What's the best way to add event in JavaScript?

I see mainly 2 ways to set events in JavaScript: add event directly inside the tag like that: <a href="" onclick="doFoo()">do foo</a> Or set them by JavaScript like that: <a id="bar" href="">do bar</a> And add event in a <script> section inside <head> or in an external JavaScript file, like that if you're using prototypeJS: Ev...

Is it possible to list named events in Windows?

I would like to create events for certain resources that are used across various processes and access these events by name. The problem seems to be that the names of the events must be known to all applications referring to them. Is there maybe a way to get a list of names events in the system? I am aware that I might use some standard...

C# Dynamic Event Subscription

How would you dynamically subscribe to a C# event so that given a Object instance and a String name containing the name of the event, you subscribe to that event and do something (write to the console for example) when that event has been fired? It would seem using Reflection this isn't possible and I would like to avoid having to use R...

Is there an event that triggers if the number of ListViewItems in a ListView changes? (Windows Forms)

I'd like to enable/disable some other controls based on how many items are in my ListView control. I can't find any event that would do this, either on the ListView itself or on the ListViewItemCollection. Maybe there's a way to generically watch any collection in C# for changes? I'd be happy with other events too, even ones that someti...

Running a regular background event in Java web app

In podcast #15, Jeff mentioned he twittered about how to run a regular event in the background as if it was a normal function - unfortunately I can't seem to find that through twitter. Now I need to do a similar thing and are going to throw the question to the masses. My current plan is when the first user (probably me) enters the site ...