event-handling

A general question about inheritence in the .NET framework

I have a general question about inheritance in the .NET framework, lets say you have 2 classes, the first is called Parent and the second is called Child. Child inherits from Parent. Parent wants to ensure that each instance of child executes a specific piece of code when it loads irrespective of whether the child has their own onLoad c...

How can I process a form's events in another class / module automatically in VB.NET

Here's my code: Public Class Form1 End Class Public Class Form1Handler Inherits Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox("I") End Sub End Class I'm trying to get Form1Handler to process Form1's events automatically. How can I do this?...

Is there an ASP.NET event that occurs after postback, but before the page is destroyed/recreated?

My ASP.NET form contains a collection of dynamically-created radiobuttons that are created and configured in the Page_Load event handler. Normally, I process postback data in the Page_Load handler, using the condition: if (IsPostBack) However, since the controls that I need to access are created IN the Page_Load handler, the postba...

ASP .NET Button event handlers do not fire on the first click, but on the second click after a PostBack

Background: I am customizing an existing ASP .NET / C# application. It has it's own little "framework" and conventions for developers to follow when extending/customizing its functionality. I am currently extending some of it's administrative functionality, to which the framework provides a contract to enforce implementation of the GetAd...

How best to associate code with events in jQuery?

Suppose I have a <select> element on my HTML page, and I want to run some Javascript when the selection is changed. I'm using jQuery. I have two ways to associate the code with the element. Method 1: jQuery .change() <select id='the_select'> <option value='opt1'>One</option> <option value='opt2'>Two</option> </select> <script> $('#t...

Outlook Add-in. How to manage Items Events

Hi, I'm doing an add-in for Outlook 2007 in C++. I need to capture the events like create, change or delete from the Outlook Items (Contact, Appointment, Tasks and Notes) but the only information/examples I've found are for Visual Basic so I don't know how to connect the event handler. Here is some information related: http://msdn.micr...

Javascript Prototype Best Practice Event Handlers

Hi this question is more a consulting of best practice, Sometimes when I'm building a complete ajax application I usually add elements dynamically for example. When you'r adding a list of items, I do something like: var template = new Template("<li id='list#{id}'>#{value}</li>"); var arrayTemplate = []; arrayOfItem.each(function(item, i...

Programming an Event listener for files in a directory on Linux

On Ubuntu linux, when you watch a flash video, it gets saved temporarily in the /tmp as flv files while the video buffers. I use vlc to directly play these files. Currently, I have scripted a shortcut that directly scans and opens the latest file in /tmp with vlc, when clicked. But, I want to program a Java application that will cont...

jQuery event handling with .live() problem with setInterval and clearInterval

jQuery 1.4.2: I have an image. When the mouseover event is triggered, a function is executed that runs a loop to load several images. On the contrary, the mouseout event needs to set the image back to a predetermined image and no longer have the loop executing. These are only for the images with class "thumb": $("img.thumb").live("mous...

When and why does an EventHandler require objects to be final?

I have the following code from a GWT Project that is part of the onModuleLoad() method (similar to Java's main method, if you don't know GWT): final TextBox t1 = new TextBox(); final Label lt1 = new Label(); t1.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { // TODO Auto-generate...

Catching the Facebook Login Event to change the HTML of the parent page

I am trying to create Facebook based login using Javascript. Once a person clicks a button he should get a div replaced by another div, if he is logged in to Facebook. However, if he is not logged in to Facebook he is asked his Facebook credentials and he logs in. However, we need the user to click the button once more for the div replac...

Adding jQuery event handler to expand div when a link is clicked

I'm using a bit of jQuery to expand/hide some divs. I need to add an event handler so that when a link is clicked, it opens a corrisponding div. Each toggled div will have a unique class assigned to it. I am looking for some advice about how to build the event handler. The jQuery $(document).ready(function(){ $(".toggle_container:not(...

Delphi: How to assign Click event to object's method?

i have a menu item, and i'm trying to assign its OnClick event handler: miFrobGizmo.OnClick := {something}; The OnClick event handler property, like almost every other event handler, is defined as a TNotifyEvent method type: property OnClick: TNotifyEvent where TNotifyEvent is: TNotifyEvent = procedure(Sender: TObject) of object;...

Delphi: How to call a method when i click a control?

i have a method: procedure Frob(Sender: TObject); that i want to call when i click a menu item. The method comes to me though an interface: animal: IAnimal; IAnimal = interface procedure Frob(Sender: TObject); end; The question revolves around what to assign to the OnClick event handler of a menu item (i.e. control): var a...

Preventing a button from responding to 'Enter' in ASP.net

I have a master template that all the pages on my site use. In the template there is an empty panel. In the code-behind for the page an imagebutton is created in the panel dynamically in my Page_Load section (makes a call to the DB to determine which button should appear via my controller). On some pages that use this template and have...

How to get currently adding item to SPList from SPItemEventProperties inside event handler?

Hi, I'm using ItemAdding Event for one of my SPLists. The question is how I can get the new not yet added item from SPItemEventProperties? I've tried to ListItem.Item but the debuger shows that the property is set to Nothing. Any correction suggest? Best Regards T.S. ...

C# wpf: Need to add mouseclick event to certain text within a textbox

I have a textbox with a paragraph of information. There are certain words in the paragraph that i want the user to be able to click on, and when clicked, a different textbox is populated with more information. I know that you can have the event for the whole textbox, but that isn't want i want. I only want to call that event when certai...

Create custom event handler occurs when recieve message from keyboard

Hi.. i need to know how to create own event handler occurs when we recieve message from keyboard or the button was pressed and then we write output in a textbox... ...

Detecting GWT RichTextArea 'dirty' state

I want to detect when the contents of my GWT RichTextArea become 'dirty' (have been changed by the user) in order to enable a 'save' button accordingly. I suppose I could listen for key presses that are likely to have changed the contents; but browser support for key presses is notoriously quirky. I suppose I could, before editing begi...

Manipulating a NSTextField via AppleScript

A little side project I'm working on is a digital life assistant, much like project JARVIS. What I'm trying to do is speak to my mac, have my words translated to text and then have the text interpreted by my program. Currently, my app is very simple, consisting of a single window containing a single wrapped NSTextView. Using MacSpeech ...