events

VB Equivalent of C# Event Creation

I'm trying to extend the GridView class to always show the header and footer even when the datasource is empty by using the code I found online (link). However, the code is written in C# but I use VB. What is the VB equivalent of the following? public event MustAddARowHandler MustAddARow; Is there a way around VB.NET not allowing ev...

VS/C#: Can I be notified of every event that gets handled while debugging?

I am currently troubleshooting a large and unwieldy GUI-based tool in Visual Studio, and was wondering whether there is any way to get some kind of notification (either by writing to the console or through a third-party tool) whenever any handled event occurs. This would make it a lot easier to track down what precisely is going on while...

Silverlight prism region events

In silverlight prism application I have a region (ContentControl) and would like to remove currently active view before adding another view. I tried to use region.PropertyChanged event but it doesn't fire. I can do it in the code where I add new view, but that will scatter my code. How to achieve this? Thanks for reply. ...

Can we have Same Delegate for Two Events

Can we have same delegate for two events ? which have same number of input parameters? or delegate and the events have one to one relation ? ...

If we don't like it for the presentation layer, then why do we tolerate it for the behavior layer?

Suppose CSS as we know it had never been invented, and the closest we could get was to do this: <script> // this is the page's stylesheet $(document).ready(function(){ $('.error').css({'color':'red'}); $('a[href]').css({'textDecoration':'none'}); ... }); </script> If this was how we were forced to write code, would we put ...

Problem with keyPress in Mozilla

I am usingtextarea to get some inputs. A label shows the updated chars left. It works fine in IE, but in FF 3.0, after reaching the max limit, it doesn't allow to delete or backspace key. I am using a javascript function on keypress event of the textarea. the javascript code is function checkLength() { var opinion = document.getEl...

attachEvent inserts events at the begin of the queue while addEventListener appends events to the queue

I use this simple working function to add events: function AppendEvent(html_element, event_name, event_function) { if(html_element) { if(html_element.attachEvent) //IE html_element.attachEvent("on" + event_name, event_function); else if(html_element.addEventListener) //FF html_element.addEventListe...

Do I need to Dispose to deregister events?

Say I have two classes, and neither of them are GUI components. Class A is a short lived object that registers for an event declared by a long lived object B. For example public A(B b) { b.ChangeEvent += OnChangeEvent; } If A never deregisters from B's event, will A never be garbage collected? Does A need a Dispose method just t...

Simple javascript to mimic jQuery behaviour of using this in events handlers

This is not a question about jQuery, but about how jQuery implements such a behaviour. In jQuery you can do this: $('#some_link_id').click(function() { alert(this.tagName); //displays 'A' }) could someone explain in general terms (no need you to write code) how do they obtain to pass the event's caller html elments (a link in thi...

ASP.NET Ajax Control Toolkit Calendar Extender help. Change on Textbox is called twice

Hi All, I have a text box on a form and a calendar extendar is associated with it. When the value changes I am calling a web service with the new date. It seems as tho the textbox change event is being called twice. I have tried to track it down and it appears the even handler is only wired up once and I also tried using jQuery.unbind('c...

jQuery 1.4.2 hover method: mouse over and mouse out issues

I have the following code to display the paragraph of a post, after the mouse is over the H1 tag, but I want to prevent displaying the paragraph if the mouse pass ramdomly over the H1 tags (they are several in one page), so the user has to stay some time over the H1 tag to display de post paragraph. In the other hand, if the user rolls o...

Need Advice on designing ATL inproc Server (dll) that serves as both a soure and a sink of events.

Hi, I need to design an ATL inproc server that besides exposing methods and properties, also can fire events (source) and serve as a sink for a third party COM control that fires events. I would assume that this is a fairly common requirement. I can also foresee several "gotchas" that I would like to read up on before commencing the ...

Global event handler

How can I define one global GridViewColumnHeader.Click handler for any ListView.GridViewColumnHeader in my project? I mean is it possible to set a Style or a Template in app.xaml for TargetType=GridViewColumnHeader so any columnheader in any listview in the project would response to the method in app.xaml.cs? ...

Schedule multiple events with NSTimer?

I have a schedule cache stored in a pList. For the example below, I have a schedule time of April 13, 2010 2:00PM and Aril 13, 2010 2:05PM. How can I add both of these to a queue to fire on their own? item 0 -Hour --14 -Minute --00 -Month --04 -Day --13 -Year --2010 item 1 -Hour --14 -Minute --05 -Month --04 -Day --13 -Year --2010 ...

how to ignore hotkeys in os x

Hi, do the Mac OS X APIs provide a method to ignore all systemwide hotkeys? I'm currently researching how to build a kiosk-mode like application. I searched the OS X Developer documentation and tried google (combinations of [cocoa, carbon, os x, ignore, global, hotkey, kiosk, event]), but nothing turned up yet. I know this has been d...

Assign delegate event handler from dynamically added child control

I have a control that handles commenting. In this control, I have set a delegate event handler for sending an email. I then have various types of controls, e.g. blog, articles etc, each of which may or may not have the commenting control added (which is done dynamically with me not knowing the id's), i.e. the commenting control is adde...

Event synchronization breaking change in Visual C# 2010

In the list of Visual C# 2010 Breaking Changes there is an entry on "Event synchronization" which states that you must now create a local copy of a delegate to check for null (before calling it) in order to avoid a race condition. Wasn't this already the "best practice" pattern anyhow? Does this change make any difference in the StackOv...

Access event.target in IE8 unobstrusive Javascript

The following function gets the target element in a dropdown menu: function getTarget(evt){ var targetElement = null; //if it is a standard browser if (typeof evt.target != 'undefined'){ targetElement = evt.target; } //otherwise it is IE then adapt syntax else{ targetElement = evt.srcElement; } //return id of <li> elemen...

Mdi Children Changed in .Net

Is there a simple way of tracking the change of an Mdi's children i.e. when they are created and closed, something like an event OnMdiChildListChanged (I realise this doesn't actually exist). I am also aware that I could have a method within my Mdi that handles the creation of child forms and logs the state of them or even create an Int...

Why doesn't the .click() not work in this instance?

Basically what this does is fadeIn pre-existing divs and then loads an image. When the image is loaded it then appends that into one of the pre-existing divs. Then it appends a new div with an id of xButton. Then later it $('#xButton').click() should hide the 3 divs. However it just doesn't work. If I change the click() to either #modalI...