event-handling

re-firing a click event on a link with jQuery

hi i've got a page (asp.net) where I trap the click event of a link. i then do some dirty checking and present a dialog to the user, $(function() { var clickedLink; $('.checkdirty').click(function(event) { if(isDirty == false){ return true; } clickedLink = $(this); $('#di...

(javascript) what is the wrap function used for regarding event handlers?

I'm trying to understand why people use a wrap function for my event handlers. For example: Example.prototype.wrap = function(obj, method) { return function(event) { obj[method](event); } } Basically, what is wrap used for? Edit: From the example linked below, the code is: String.prototype.capitalize = String.prototype.c...

(javascript) why do i need to use a wrap function for event handlers?

I'm trying to understand why in the following code I need Dragger.prototype.wrap and why I can't just use the event handling methods directly: function Dragger(id) { this.isMouseDown = false; this.element = document.getElementById(id); this.element.onmousedown = this.wrap(this, "mouseDown"); } Dragger.prototype.wrap = func...

Equivalent of PreviewKeyDown of C# needed for native C++/MFC

Hi, I used a ActiveXControl in a C# Forms application and had the possibility to implement a PreviewKeyDown event handler for that ActiveXControl. That was needed to specify that, e.g. the [ALT] key, is an input key. For some reasons or other I have to reimplement the application in native C++/MFC and don't know how to specify that th...

How should I set up a user control to fire events of its children as if they were its own?

In other words, I have a UserControl that has, for example, a label on it. Well, when the client registers with the MouseMove event of the UserControl, it should get that event whether the mouse is over the label or somewhere else on the UserControl. What would be the best way to set this up? C# ...

Is possible to capture KeyDown event when current document is in design mode?

As you know, most of rich text editor use iframe to create WYSIWYG editor. In iframe contain document that is in design mode. I want to capture key down event when user press '@' character in rich text editor for displaying autocomplete for it. By the way, i cannot see any fired event inside design mode. How to solve this question? Tha...

Why don't UI elements reflect their state in Button Click event handler?

In the following example, how can I get: the button to be "disabled-grey" the message to say "working..." while the work is being done, not after the work is done? XAML: <Window x:Class="TestIsEnabled8938.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/...

Is possible to exactly find position of KeyPress event in browsers except IE?

From my recent question, I use KeyPress event for detecting '@' character in rich text editor. By the way, I just found that KeyPress event in other browser like Firefox 3.5 and Google Chrome 4 do not return any position in this event. For clarify, my position is a distance from top or left of screen. In this case, it should be distance...

Checking if an event handler exists

Following on from this post - what are the disadvantages when using the -= then += approach suggested when I only ever want one handler event to fire? _value.PropertyChanged -= _handlerMethod; _value.PropertyChanged += _handlerMethod; ...

[C#] How can I associate an event handler with a 'group method'?

I am trying to trigger a process when a RemoveAt(i) method is performed on an ArrayList I have defined. Can this be done? How? Thanks, Asaf. ...

VB.Net event handler registration for nested linkbutton

Hi All, I have a linkbutton that is nested in a datagrid that is nested in a datalist (yes, very strange, but unfortunately it's part of the site which I cannot change). Essentially I want the linkbutton to fire an event handler that calls Response.Redirect(e.CommandArgument)). In other words, I already have the URL that I want to redir...

Bypassing event.stopPropagation

Hi, I'm writing a Javascript add-on (not in jQuery) which starts working when a certain event has been triggered. It works fine on most of the sites, but I encountered problems in sites that use stopPropagation(). Is it possible to bypass this and attach the event anyway? Thanks! ...

Is it possible to create eventlisteners for string, int, bool at all?

Is it possible at all to create eventlisteners (i.e. when the value changes) for a variable of type string, int, bool, etc.? I haven't seen this in any programming language so far, except for some Collections (like ArrayCollection in Flex), which use events to detect changes in the collection. If not possible at all, why not? What's t...

Silverlight 3 Custom Control Event-handling Navigation

I have a Silverlight 3 aplication, The solution (of 3 projects) looks Like this: ChartsCustomControl    PieChart.cs SLGrid.Web SLGrid    NavigationPage.xaml    Views       PieChartPage.xaml          PieChartPage.xaml.cs I'm using the navigation Frame control, and have a folder named Views for the different pages. PieChartPage.xaml.cs ...

Listen for Events from Browser "Find" Window in JavaScript

Is there a way to listen for typing into the browser's "find" window in JavaScript? I'd like to be able to reinterpret the search text from JavaScript. What do I need to add an event listener for? ...

WPF - Update panel's content with a button click

Hi evryone, I am pretty new to WPF and I cannot figure out how to update a specific part of my page with a single button click. In my application design I have a menu with buttons to the left and to the right I have a series of panels. One is status bar (bottom), one Info bar(top) and inbetween I want to visualize the info that the pro...

Attach event to control inside a Placeholder using designer ASP.NET C#

Hi Everyone, Is it possible to add an event to a control which is inside another control, like say a PlaceHolder control using the designer? When the control is alone on the form this works perfectly... you simply add it from the properties window by clicking the thunder icon and clicking on the event needed. I know I can do by adding...

datavgrid iew control bounded to a collection question

Hi All, I'm new with DataGrid View control, and I've this problem: I would like to build a C# application with this control, bounded to a custom collection. If I change the data in the collection, I would expect that the grid should change in accordance. No problem in implementing this. The question is, this control comes with the poss...

CommandBinding Ctrl + Spacebar

I handle commands inside a RoutedCommand class that implements RoutedUICommand. This would help me to block or override a command by checking their CanExecute and Execute if needed. I can override EditingCommand, ApplicationCommand, etc.. One of the command that I cannot even handle is Ctr + Spacebar. Is it a MediaCommand or some other t...

Event handler in DataTemplate

I have WPF ComboBox inside a data template (a lot of comboboxes in listbox) and I want to handle enter button. It would be easy if it was e.g. a button - I would use Command + Relative binding path etc. Unfortunately, I have no idea how handle key press with a Command or how to set event handler from template. Any suggestions? ...