How to “Snap” the Cursor

If you’re attempting to create that foolproof Windows application, one
great technique to use is snapping the cursor to a particular control, thus
anticipating the user’s next click.

The following neat little function does exactly that. Simply pass in a control
to get it started: it’ll calculate the exact bottom middle location of
the control and then snap the cursor to that position. Here’s the code:

by boarderstu (1 replies)

by konikula (1 replies)

Published 3 years ago, running time 0h56m

Recorded on PI day, Carl and Richard talk to the one-and-only Eric Lippert from the C# Compiler team. But we don't only talk about C#! The conversation wanders around all the languages, a little F#, a little IronPython, heck, even VB.NET! Eric talks about Project Roslyn, Microsoft's efforts to ma.