Using SynchronizationContext in Windows Forms

Posted by Anuraj on Friday, March 22, 2013 Reading time :1 minute

.Net .Net 3.0 / 3.5 CodeProject 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 to execute a section of code in the UI context (the thread that created the UI). Also, it allows us to specify if the background thread will block waiting for the UI thread (using Send) or will not block (using Post). SynchoronizationContext class can be used in Windows Forms, WPF, and ASP.Net etc. For Windows forms, you can get the UI context from the WindowsFormsSynchronizationContext.Current property. For WPF, the implementation is DispatcherSynchronizationContext class.

How to move a window or form without titlebar

Posted by Anuraj on Thursday, March 14, 2013 Reading time :1 minute

.Net Win 32 API Windows Forms

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.

Using Microsoft Ink Picture control

Posted by Anuraj on Wednesday, March 6, 2013 Reading time :2 minutes

.Net .Net 3.0 / 3.5 CodeProject Windows Forms

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 post is about working with InkPicture control.

How to prevent automatic screen lock in WP7

Posted by Anuraj on Monday, February 11, 2013 Reading time :1 minute

.Net Silverlight Windows Phone

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.

Building a language translation bot using Skype and C#

Posted by Anuraj on Tuesday, February 5, 2013 Reading time :1 minute

.Net .Net 4.0 CodeProject Windows Forms

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.

How to exclude test assembly from code coverage in VS 2012

Posted by Anuraj on Monday, January 28, 2013 Reading time :1 minute

.Net Code coverage Visual Studio

If you are using VS 2012, by default Code coverage results are available for Test assembly also.

K-MUG User Group Meeting - 19th Jan 2013

Posted by Anuraj on Saturday, January 19, 2013 Reading time :1 minute

Miscellaneous User Group Activities

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 session was from Yanesh Tyagi. His session was about productivity tools & tips for visual studio 2010. He discussed various keyboard shortcuts and few visual studio extensions. You can download the presentation from here The next planned session was from Anoop Madhusoodhanan, on WinRT / Windows8 via C#, but it didn’t happened. Instead Praseed Pai, another K-MUG speaker and technology enthusiast, took another session on Modern JavaScript development. Another nice session from him. And thanks to the live demo.
Translate
Subscribe
BMC logoBuy me a coffee


Copyright © 2018 - Anuraj P. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Hosted with ❤ by GitHub