events

Detecting browser capabilities and selective events for mouse and touch

I started using touch events for a while now, but I just stumbled upon quite a problem. Until now, I checked if touch capabilities are supported, and applied selective events based on that. Like this: if(document.ontouchmove === undefined){ //apply mouse events }else{ //apply touch events } However, my scripts stopped working ...

How do I trap a double-click event on a ListView that has no items?

In my C# app, I have a ListView on a Form. I want the user to be able to double-click on a section of the ListView when no items are selected in order to pop up a "New Item" dialog. The problem is that the DoubleClick event for the ListView only fires if an item is selected. Is there a way to do this? ...

FB.Data.query with better performance

I'm using this code for take user's events from facebook: var query = FB.Data.query("select eid,name,start_time,location,venue,pic_small,pic_big,description from event WHERE eid IN (SELECT eid FROM event_member WHERE uid={0}) AND start_time >= now() ORDER BY start_time LIMIT 10", uid); query.w...

Transform any JavaScript function into a page event

I need to be able to achieve the following (one way or another): function ShowContent() {} document.onShowContent = function () { // anything I want to happen.... } What I'm trying to do is to add a kind of listener to me Advertisement code on the page that will auto refresh the ad slot when a specific function is called. Instea...

MouseLeave LostFocus events Silverlight

Hello! I'm writing a Windows phone 7 Silverlight Application. and i have to set Visibility of my Stackpanel to Collapsed when mouse leaves this control. But this event occurs even if i simply click on my control without mouse movings. Lost focus event doesn't work too. How to achieve my goal? Thx in advance! ...

Bind an event handler to multiple elements jQuery?

Hello all. I've done some experimenting, but can't seem to successfully bind one event handler to multiple elements using jQuery. Here's what I've tried: $('selector1', 'selector2').bind('click', function() { $('someSelector').removeClass('coolClass'); }); I've tested all my selectors, and they are all valid. Is what I'm t...

C#. Saving information about events and event handlers and removing handlers using this information

I have an object which is creating several event handlers using lambda expressions, and I need to remove all handlers created in that object in one time. I'm trying to create some unified static object which will 'know' which handler relates to which object and event if event handler was created through this static object. I tried some...

CSS3 transition events

Are there any events fired by an element to check wether a css3 transition has started or end? ...

Receiving SQL Server events from a CLR function

I wrote a CLR class with several methods, which are linked as functions in a SQL Server 2005 database. When several of these functions are used in scope of one transaction or connection, I need another one to be automatically executed to clean up some stuff, at the time of transaction or connection close (either time is good for now, lat...

Best practice - logging events (general) and changes (database)

need help with logging all activities on a site as well as database changes. requirements: * should be in database * should be easily searchable by initiator (user name / session id), event (activity type) and event parameters i can think of a database design but either it involves a lot of tables (one per event) so i can log each of t...

C# detect when form becomes unfocused?

Is there a winforms event that fires when the user switches from a form to another window? I.e. Not through minimizing, but just by clicking on another window. How can I detect when the form becomes inactive? Thanks! ...

How can I delay running some JS code until ALL of my asynchronous JS files downloaded?

UPDATE: I have the following code: <script type="text/javascript"> function addScript(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } addScript('http://google.com/google-maps.js'); addScript('http://jquery.com/jquery.js'); ... // ru...

c# Counter requires 2 button clicks to update

Hi, I have a problem that has been bugging me all day. In my code I have the following: private int rowCount { get { return (int)ViewState["rowCount"]; } set { ViewState["rowCount"] = value; } } and a button event protected void addRow_Click(object sender, EventArgs e) { rowCount = rowCount + 1;...

Event-source in Opera - how to avoid reconnect?

Opera supports server-side events via event-source element. W3C specification says that the connection with the serwer is being auto-reconnect. Server can maitenance the connection by sending "retry: num_of_ms". It is possible in Opera to avoid reconnect? I can not find any documentation about this tag in Opera. May be there is somethin...

How to pass value when subscribing to event and obtain it when the event is triggered (DynamicMethod usage problems)

The task is to create event handlers in runtime. I need the one method to be called with different parameter value for different events. The events and their number are only known in runtime. So I'm trying to generate dynamic methods, each of which will be assigned to some event, but in general they all just pass some value to an instanc...

Button Click Event Getting Lost

I have a Menu and Submenu structure in Silverlight, and I want the submenu to disappear when the parent menu item loses focus - standard Menu behavior. I've noticed that the submenu's click events are lost when a submenu item is clicked, because the parent menu item loses focus and the submenu disappears. It's easier to explain with cod...

MS Access raise form events programmatically

Is it possible to raise built-in MS Access form events programmatically? I have a feeling it isn't but thought I would check. (I am using Access 2003). For instance, I want to do something like this within a private sub on the form: RaiseEvent Delete(Cancel) and have it trigger the Access.Form delete event -- i.e. without actually de...

Is there a way to trigger inline javascript execution inside some div from jquery?

I have some container on a page with inline javascript. Is there a way to trigger its execution once again after it was initially triggered automatically on a page load? <div id="mydiv"> <script type='text/javascript'>alert("trigger me again");</script> </div> ...

Getting touch events from points -6,0 to 320, 470

Hi, I am just trying to program a simple drawing program. Along with drawing, I would like to know the points that I am currently touching. I am just using a window, subclassed viewController and a subclassed view.I also hid the status bar. Everything seems to work the way it is supposed to. The thing is that I can't get it to draw with...

JavaScript: how to create a JS event that requires 2 seperate JS files to be loaded first while downloading them asynchronously?

I want to perform asynchronous JavaScript downloads of two files that have dependencies attached to them. // asynch download of jquery and gmaps function addScript(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } addScript('http://google....