events

jquery add more to a click function

I have a function that is bound for a page object in some Javascript files that are loaded on each page. I need to add some more functionality to that already defined event handler. Here is an example of what i mean. The object with the currently defined click event closes a pop-up div that appears on the screen. When this is clicked (...

C#/WPF: Catch Routed Event (UIElement.PreviewKeyUp) from UserControl

Hello, I've a UserControl which contains a TextBox called myTextBox. This UserControl is placed in a MainWindow.xaml where I'm trying to catch the "UIElement.PreviewKeyUp". Now when debugging, I can see the "UserControl" as sender, not the TextBox. How can I check if the KeyEventArgs e (especially e.Key) were sent from the TextBox call...

Is an Event running in another thread? (.Net Compact Framework).

Hello! I'm developing a Windows Mobile 5.0 or above with .Net Compact Framework 2.0 SP2 and C#. when I try to access the control's width on a method that handles an event it throws me the following exception: Control.Invoke must be used to interact with controls created on a separate thread. Is this method running in another thread? ...

Jquery Bind Event

Hello, I have the following code: $('#form_field, #button').bind('change click', function() { // take action } It works fine. However, I want to trigger the same action when 'change' is used for '#form_field' and 'click' for '#button' (not when 'click' is used for '#form_field'). I know that can be done using the following code: $(...

How do I make a textbox update as an event happens not when the code has finished?

private void Discogs_NewStatusMessage(object sender, NewStatusMessageEventArgs e) { textBox1.Text += e.Message() + "\r\n"; } I have the above event handler on my form and am trying to update a textbox on the form to show messages that occur at different points in code from a class to show progress. All the messages ap...

WPF- Catch the clicking of a button that was added to a style (ListBoxItem)

I have added a button to a template for a ListBoxItem. I want to know how to catch the click for the button (not selecting the ListboxItem). The button clicks just fine in the UI, but I can't seem to find out how to wire up code so I can catch it. I tried using: <EventSetter Event="Click" Handler="Button_Click"></EventSetter> but...

DataGridView CellFormatting event preventing form painting

I am using C#, Winforms, and .Net 3.5 My form has a custom DataGridView (double-buffered to prevent flickering during my cellformatting events, as seen here). When I perform a database search, I bind the resulting dataset to the datagridview. I handle the CellFormatting event to paint rows a certain color, depending on their data. My ...

Event issue with ASP.net Update Panel

I am completely stumped on this and would really appreciate any help. I am working on a user control that is situated inside of an update panel. There is a button on the form which loads some data. This is working correctly. There is also a drop-down box to filter the data. Changing this does initiate a post back, however nothing happe...

How to attach an event to IHTMLDocument2 link elements in Delphi?

I'm using this code to get all the links from an IHTMLDocument2: procedure DoDocumentComplete(const pDisp: IDispatch; var URL: OleVariant); var Document:IHTMLDocument2; Body:IHTMLElement; Links:IHTMLElementCollection; i:integer; tmp:IHTMLElement; begin try Document := (pDisp as IWebbrowser2).Document AS IHTMLDocument2; ...

Race condition firing events in AS3

Hello I have some troubles firing and removing events in the right chronicle order. The code below gives the following output: save poster into db, and dispatch event calling service, dispatch event removed = false calling service, dispatch event removed = false calling service, dispatch event removed = true save poster into db, and d...

SQL Server slow select from large table

Hello, I have a table with about 20+ million records. Structure is like: EventId UNIQUEIDENTIFIER SourceUserId UNIQUEIDENTIFIER DestinationUserId UNIQUEIDENTIFIER CreatedAt DATETIME TypeId INT MetaId INT Table is receiving about 100k+ records each day. I have indexes on each column except MetaId, as it is not used in 'where' clause...

Is there any difference in following javascript snippets?

Is there any difference in both of these snippets: Writing this snippet at the end of HTML // where should we write the script anyways, is it inside body tag or just after body tag. <script type="text/javascript"> insertNavigation(); // any arbitrary method </script> Or writing this snippet at the end of HTML <script type="text/j...

Flex datagrid - determining when grid has completed renderering?

hi, i have a datagrid which contains a number of itemrenderers, it is populated each time a user does a search. Is there an event which can tell me when the datagrid has completed rendering all new rows and item renderers? I need to trigger an event once everything has been created so that i can resize then container which holds the g...

Best practice advice in generating and consuming business level events

Hi, We are currently finishing an architecture plan for a new software application we are developing next year in ASP.NET MVC / C#. We are planning to construct the application following Domain-Driven design patterns and techniques and i'm wondering if anyone has any advice / views on an aspect of the proposed system. One of the busin...

SynchronizingObject for an event

With Timer objects, I can set the SynchronizingObject property to avoid having to use invoke when updating the GUI from the timer's event handler. If I have a class that instead subscribes to an event and has to update the GUI in the event handler, is there an analogous concept? Or do I have to write the InvokeRequired boilerplate code? ...

Events and Memory Leaks in .NET

I'm using C# .NET 3.5 ... and I've been working to decouple a BLL object by moving database related activity into a seperate worker object. The worker object adds entities to the database and events a success or failure message back to a BLL object. When I instance the worker object in the BLL I wire up the worker's events and set the...

jQuery problem with a blur event

Hello, Here's my problem: I have a div element that when it's clicked, another div shows up. Now I have no idea how to make that wherever I click on the page, this div gets removed. I mean, I know how to remove it, but which kind of events should I have in consideration to do such thing!? I can't make it with focus/blur can I. I mean I...

Events from UserControl as ItemTemplate in WPF ListBox

In WPF, I have a ListBox with a UserControl as its ItemTemplate - all data shown ok. I have now added a text box for input in that user control. In an MVVM design, I want to take some action (re-calculate values) in the main window when the user edits the content of the text box in the user control, in the item template, in the list box....

Building game logic with events

Hi! I'm making a game engine in C++. It is supposed to read all its game-level logic from XML files, so I'm in need of a simple, but rock solid way of creating and handling events. So far all i have done is to use an Action class. It's practically equivalent to throwing callbacks around. An example could be an object (a map), that can ch...

How to raise a global event in dojo?

Hello, I am trying to raise an event to all of the widgets that catch it. I have an authentication widget and other widgets that depeand on the fact that the user is logged in. I would like to raise an event to all of those widgets when a user is logged in without connecting them manually. How can it be done? Thanks in advnace, Omer. ...