Using SynchronizationContext in Windows Forms

Long back I wrote a post about how to fix - System.InvalidOperationException – Cross-thread operation not valid exception, while we try to access user interface elements from a different thread, other than the thread(normally main thread), which created the user interface elements. .NET 2.0 brings us SynchoronizationContext which allows us...


How to move a window or form without titlebar

In my current project I had to implement move for a Form, which doesn’t have a title bar or FormBorderStyle property set to None. Instead of title bar I was using a Panel with background Image. Here is the code snippet. public const int WM_NCLBUTTONDOWN = 0xA1; public const int...


Using Microsoft Ink Picture control

The InkPicture control provides the ability to place an image in an application and enable users to add ink on top of it. It is intended for scenarios in which ink is not recognized as text but is instead stored as ink. InkPicture control extends the default picturebox control. This...


How to prevent automatic screen lock in WP7

If you are developing some travel applications or fitness applications, you may want to disable automatic screen locking feature of Windows Phone. You can disable this using UserIdleDetectionMode property of PhoneApplicationService.Current class. Microsoft.Phone.Shell.PhoneApplicationService.Current.UserIdleDetectionMode = Microsoft.Phone.Shell.IdleDetectionMode.Disabled; You can find more details about Idle Detection for Windows Phone and best practices here...


Building a language translation bot using Skype and C#

In Google talk, there was some bot service available which will help to translate from one language to another. You can implement similar service using Skype with the help of Skype4COM.dll. In this implementation for language translation, the Bing soap API is used. Skype4COM is a Windows based COM DLL...


How to exclude test assembly from code coverage in VS 2012

If you are using VS 2012, by default Code coverage results are available for Test assembly also. There is no direct way to disable this behavior, either you need to use the ExcludeFromCodeCoverage attribute or you need to use the runsettings file. The ExcludeFromCodeCoverage is pretty straight forward; you need...


K-MUG User Group Meeting - 19th Jan 2013

Another K-MUG UG Meeting, as usual the event was awesome. (Sorry I forgot to post about the event in my blog.) The first session was from Shiju Vargheese on Windows Azure Websites. A good introduction session about Windows Azure website. You can download / view the presentation here The second...