events

Dynamically created controls and the ASP.NET page lifecycle

I'm working on an ASP.NET project in which the vast majority of the forms are generated dynamically at run time (form definitions are stored in a DB for customizability). Therefore, I have to dynamically create and add my controls to the Page every time OnLoad fires, regardless of IsPostBack. This has been working just fine and .NET ta...

C# BackgroundWorker RunWorkerCompleted Event

My C# application has several background workers. Sometimes one background worker will fire off another. When the first background worker completes and the RunWorkerCompleted event is fired, on which thread will that event fire, the UI or the first background worker from which RunWorkerAsync was called? I am using Microsoft Visual C# ...

Can Internet Explorer bind events to absolute positioned elements ?

Can Internet Explorer bind events to absolute positioned elements ? I can't bind a "click" to an element that is overlapping another. Have tried loads of different ways, here a few tests that don't work in IE: //version 1: $(".classHolder").click(function(){ alert( $(this).html() ); }); //version 2: $(".classHolder").each(function()...

Trigger jQuery Qtip on FullCalendar dayClick

Hello, I have a jquery fullcalendar. I would like to trigger jquery QTip (or other jquery solution (such as a lightbox)) when I click on a day to bring up a list of options. This question is similar to this question already posted, however different enough to warrant a new question. There is an event callback for this but I am unsure h...

Silverlight Listbox firing MouseRightButtonDown, but not MouseLeftButtonDown

I have this problem in a bigger Project...... so I set up a 'Testpoject' as Proof of Concept: New Silverlight-Application Add Listbox Fill listbox with a few Checkboxes Register listBox1_MouseLeftButtonDown register listBox1_MouseRightButtonDown You will see, that the listBox1_MouseLeftButtonDown won't fire under any circumstances......

Win32 Event vs Semaphore

Basically I need a replacement for Condition Variable and SleepConditionVariableCS because it only support Vista and UP. (For C++) Some suggested to use Semaphore, I also found CreateEvent. Basically, I need to have on thread waiting on WaitForSingleObject, until something one or more others thread tell me there is something to do. In...

Is it possible for onunload confirm to open a new url in the same window?

Hi - this is my first post and I'm a JS novice, so please forgive my ignorance... Heres my question, its in two parts: 1.) At onunload I want an alert that asks the user if they would like to go to a related URL. The code I'm using works, but it open the URL in a new window and this can be blocked by a pop-up blocker even though the us...

Are there any shortcuts/easier(VB) style way for raising events in C#?

Example in VB I have a worker class Public Class worker Public Event EventNumber1(ByVal messages As Dictionary(Of Integer, String)) Public Event EventNumber2(ByVal message As String) Public Sub CallEventNumber1() Dim dict As New Dictionary(Of Integer, String) dict.Add(1, "EventNumber1 First message") ...

Using WeakReference to resolve issue with .NET unregistered event handlers causing memory leaks.

The problem: Registered event handlers create a reference from the event to the event handler's instance. If that instance fails to unregister the event handler (via Dispose, presumably), then the instance memory will not be freed by the garbage collector. Example: class Foo { public event Action AnEvent; pu...

Avoiding a large number of custom EventArgs?

The class library I'm refactoring has a large number of events (over 50) each with its own Delegate, even though many have the same arguments. I starting switching them all over to use EventHandler and custom EventArgs but it is proving to be tedious and time consuming. Is there an easier way to handle a situation like this, when you ha...

Progressive enhancement of anchor tags to avoid onclick="return false;"

Unobtrusive JS suggests that we don't have any onclick attributes in our HTML templates. <a href="/controller/foo/1">View Foo 1</a> A basic progressive enhancement is to convert that anchor tag to use XHR to retrieve a DOM fragment. So, I write JS to add an event listener for a."click" then make an XHR to a.href. Alas, the browser...

wxPython dictionary of classes to events they call

I was wondering if there was a dictionary containing string versions of wxPython class (like 'Button' for wx.Button) to the events they call. This is what I want: {'Button': wx.EVT_BUTTON, ...}. Is there a dictionary like this anywhere in the module or on the web? ...

Is it possible to capture mouse events on a scroll bar in JavaScript

I have an HTML element with overflow: scroll. The click event listener registered with the element is triggered when I click on the element, but not when I click on the scroll bar for the element. Is it possible to capture mouse events which occur on an HTML element's scroll bar? The reason I want to do this is to make a visual popup el...

ASP.NET- forcing child/container events to fire before parent onload?

I'm working on a questionnaire type application in which questions are stored in a database. Therefore, I create my controls dynamically on every Page.OnLoad. This works like a charm and ViewState is persisted between postbacks because I ensure that my dynamic controls always have the same generated Control.ID. In addition to the user ...

Something like oEvent.cancelPostBack for DropDownList in asp.net server side code

Hi, I am having the code for selectedIndexChanged event of a DropDownList in Asp.Net that looks somewhat like this protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { //Get the value of Base category on the basis of the new index selected. if(BaseCategory belongs to (SomeValues)) { //do some actio...

WPF: Routed event for showing detail view of list box item?

So what I want to accomplish is that I have a listbox of items (for example: items in a basket) and when I mouse over one of them, I want to see a detailed view in another part of my window (with image and all that). BASICALLY what I did works - but there are three things that I don't like: a) I use "ItemsControl" so I have to bind the...

Mac event tap just delays discarded events

I'm trying to write some code that discards all keyboard and mouse events when enabled on Mac OSX 10.6. My code runs as the root user. The approach I'm taking is to create an event tap that discards all events passed to it (while enabled). The event tap callback function looks like this: CGEventRef MyTapCallback(CGEventTapProxy proxy, ...

jQuery resize event for div children

$("div.content-left > *, div.content-main > *" ).live('resize',function(){alert("Size changed")}); does not work, because the resize event only applies to window resizes. But in my case the divs change size late, because the content is loaded late by an ajax request - or by clicking a panel menu. I definatley need to avoid to register...

C#: Hook up all events from object in single statement.

In my domain layer all domain objects emit events (of type InvalidDomainObjectEventHandler) to indicate invalid state when the IsValid property is called. On an aspx codebehind, I have to manually wire up the events for the domain object like this: _purchaseOrder.AmountIsNull += new DomainObject.InvalidDomainObjectEventHandler(HandleDo...

Remove an event and setting it again

Hello. I have a mouseover and a mouseout event on a menu, that shows/hides a drop down menu. This drop down menu has some other menu items, and I wish to (when clicked) to remove the mouse out event on the target that showed the menu. But once another target is clicked I wish to enable this event again. I hope I explained it well. Thi...