events

How to determine whether TextChanged was triggered by keyboard in C#?

I have a method private void textBoxPilot_TextChanged(object sender, TextChangedEventArgs e) { ... } where the textbox in question takes a search string from the user and populates a ListBox with the results on every keystroke. Subsequently, when an item is picked from the ListBox, I would like the choice reflected in the same Textb...

javascript setAttribute 'className' works onLoad, but not onClick

Why does the following work for onLoad, and not onClick, and what would be the solution? Thanks in advance... <head> <title>Untitled Page</title> <LINK href=CSS/showdetails.css type=text/css rel=stylesheet /> </head> <body OnLoad="javascript:showdetails()"> <script language=JavaScript src=js/showdetails.js type=text/javascript>...

signals and slots vs. events and event listeners

Straight to the point! How do signals/slots and event/event-listeners compare? Are there any pros and cons? Which one should I consider and why? Thanks in advance! ...

Silverlight 4: Event not firing?

Newb here. I am instantiating the class below from a Silverlight page's code-behind. I am trying to understand why the threads that spin off (the loadoperation and the worker) successfully raise the Selected event on the class when their completed events fire, but the Select event on the method call (in this case the constructer) itsel...

Help with Event-Based Components

I have started to look at Event-Based Components (EBCs), a programming method currently being explored by Ralf Wesphal in Germany, in particular. This is a really interesting and promising way to architect a software solution, and gets close to the age-old idea of being able to stick software components together like Lego :) A good star...

What event should I monitor for a timely task in WPF?

I am writing a WPF application using C#. I need the application to continue to run for two minutes and then perform some maintenance. The user may not be interacting with it so user driven events are not guaranteed. What is the event I should be monitoring to fulfill this requirement? Here is some pseudo code of what I am considering...

About Load event of Windows Forms UserControl

Is there a guarantee that the Load event if an UserControl always occurs after the InitializeComponent() method and the constructor have been completed? ...

How to edit 'onchange' attribute in a 'select' tag? (using jquery)

I'm trying to edit the 'onchange' event of an existent 'select' element. For example purposes I have the following code: <select id="sel_id" onchange="javascript:foo();" > and whenever I try to change its 'onchange' attribute I was using the following: $("#sel_id").attr("onchange", "foo_2()"); FYI, this code which should be f...

Emulate W3C event capturing model in IE

Is it possible to emulate event capturing in Internet Explorer? An example: <a>one</a> <a>two</a> <a>three3</a> <script> var links = document.getElementsByTagName("A"); for (var i=0; i < links.length; i++) { links[i].onclick = function(){ alert("clicked"); }; } </script> I want to prevent all these click events from firing. ...

Client side iCalendar Event Creator

Hi, I need to add some functionality to a web application that allows a user to create an event which will be added to a calendar. I would like to give the user as much flexibility as possible when created events (single events, recurring events, etc) ... bascially as much of the flexibility that iCalendar allows for its Events as possi...

Motionevent.getX and getY

I need help understanding the following. Say I have a display that is 854x480 pixels. Why is it that the MotionEvent.getX and getY methods return floats? As far as I can tell, the pixels on the display are discrete integers, there is no such thing as a half a pixel on the display. ...

How to add event callbacks to sqlalchemy models?

There is a page demonstrates how to do it when using Elixir: http://beachcoder.wordpress.com/2007/05/02/adding-event-callbacks-to-sqlalchemyelixir-classes/ But I don't use Elixir, I just use sqlalchemy directly, and define my models as: Base = declarative_base() class User(Base): __tablename__ = "users" ... def send_emai...

Why sending events for a sender is forbidden in C#?

Quote from: http://msdn.microsoft.com/en-us/library/aa645739(VS.71).aspx "Invoking an event can only be done from within the class that declared the event." I am puzzled why there is such restriction. Without this limitation I would be able to write a class (one class) which once for good manages sending the events for a given category...

C# async callback still on background thread...help! (preferably without InvokeRequired)

Hi there, I am writing a very simple asynchronous helper class to go along with my project. The purpose of the class is that it allows a method to be run on a background thread. Here is the code; internal class AsyncHelper { private readonly Stopwatch timer = new Stopwatch(); internal event DownloadCompleteHa...

Delphi CreateOleObject events

Hello there is a code var myobject:OleVariant; begin myobject:=CreateOleObject('SomeNamespace.SomeClass'); end; this com object has event OnClick for example. How must I connect to them without importing tlb? Regards, Yuriy ...

c# how to deal with events for multi dynamic created buttons

Hello, I have created a WinForm and I added to it dynamic Buttons, how I can deal with it's events public static void Notify() { var line = 3; Form fm = new Form(); fm.Text = "Hello!"; fm.ShowInTaskbar = false; fm.ShowIcon = false; fm.MinimizeBox = false; fm.MaximizeBox = false; fm.FormBorderStyle = Fo...

VB.net 3.5: How do i calculate a running total number of Click events a button has recieved over the course of the runtime...

I am scripting a VB project for class and need to figure out how to calculate a running total number of Click events a button has recieved over the course of the runtime. The project is supposed to display the total number of times that the Calculate total number of times that the "CalculateButton_Click(ByVal sender As System.Object, ByV...

Javascript: Delaying display of the context menu (Chrome)

I'm trying to dynamically create context menu items in a Chrome extension; this involves sending a request to the main extension process to modify the menu, and blocking the menu from being displayed until a response is sent. I've been experimenting with different solutions all day, and I have yet to come up with one that works. For ex...

Programmatically Simulate a KeyDown Event for RichTextBox in C# 2010

Hi, I have a RichTextBox on my form, and I want to use the default behavior as the RichTextBox does, such as, Ctrl+Z (Undo) or other actions (Ctrl+Y, Ctrl+X, Ctrl+V). If users use the shortcut keys (Ctrl+Z), it's perfect. But what if the users click a ToolStripButton? How can I programmatically simulate a KeyDown Event for RichTextBo...

JQGrid onselectrow events - custom multiselect

Hey there! I've been working with JQGrid a lot, and would recommend it to everyone. The one feature I don't really like is the built in multiselect which doesnt use special keys like shift and ctrl, doesnt give you much control and forces checkboxes to be shown. I would like to implement my own multiselect as follows: In onSelectRow- c...