Category: WinForms
Shutdown or Restart the Computer Using C#
The easiest way to shutdown, restart, or hibernate a computer programmatically using C# is to use the shutdown command-line tool that comes with Windows.
Multithreading in .NET With the BackgroundWorker
Sometimes a smart client application needs to do a lengthy operation that can slow down the performance of the whole application and make it unresponsive. This can be solved by executing the operation in a separate thread using the .NET Framework’s BackgroundWorker control. The BackgroundWorker executes such operations asynchronously in a thread separate from the [...]
Minimize an Application to the System Tray
To be able to use the System Tray in Visual Studio, drag and drop the NotifyIcon control. The important properties to set are Text and Icon.
Programming for Multiple Screens in DotNET
This is a piece of code I used for an application that needed to be displayed in 2 screens setup as extended view. I used a simple calculation to know the selected screen’s coordinates and place the form in its center.
Creating Your Own Travian Utilities
Travian the well known browser game has a downloadable file for developers in each of its servers that provides details of all the players of the server. The file contains a list of SQL INSERT statements, one for each player. Although the statement doesnt provide military or attack information, that can be used to cheat [...]
Using Microsoft Office’s OCR Engine
The Microsoft Office Document Imaging library that is provided with Office 2003 and Office 2007, has Optical Character Recognition (OCR) that can extract text and layout from image files. As you can see from the code below, it doesnt need much to use it. So to start first include the COM object ‘Microsoft Office Document [...]



Connect