Added some cool new features to my game. Suggestions and feedback appreciated.
Tag Archives: C#
Image Viewer application using C#
A detailed tutorial about creating an Image Viewer or Picture Viewer application in C#. This application also converts Images from one type to another.
Following are the features of this application:
- Open / Save images.
- Convert images.
- Rotate Images.
- All popular image formats are supported.
Let’s get started! Continue reading
Screen Capture Class For C#
A class that will help you take screenshots quickly and easily.

Following are the features of this class:
- Take screenshot of the whole screen
- Take screenshot of a particular area using a Rectangle
- Copy the screenshot to Clipboard.
- Save the screenshot straight after it is captured.
- All popular image formats are supported.
C# – Check if connected to internet
I was working on an application which checked for updates. I used WebRequest/WebResponse for checking updates. It showed a continuous Progressbar while checking for updates. But there was a problem. It worked properly when you were connected to internet but it just showed the progressbar all the time if not connected.
The solution for that was to check for internet connection before checking for updates. If connected then check for updates otherwise show an error.
Checking for the state of internet connection is very simple. Let’s get started.
Crop Image – C# and VB.NET
For cropping an image in C# & VB.NET we can use the Graphics class. We’ll use a method (or function in VB.NET) which will take 2 parameters, a source image and a rectangle of the section that should be cropped. Let’s code!
C# – Autocomplete Textbox
There are times when you’ll need an autocomplete textbox. Autocomplete textbox makes the user’s life easier. It shows suggestions as the user types. In case of a web browser, if you type “goo” it will automatically show all the suggestions starting with or containing “goo” like “Google, Goofy” etc. It really helps both you or your users when hunting for something. Of course, it seems difficult to set up, but the reality is very different. So whether they’re typing in “find O2 UK BROADBAND” or you’re hunting for “that holiday video”, then your users are likely to find it a lot faster. Enough talk! Lets get on with it.
Fortunately, textbox has a built-in autocomplete feature! We don’t have to do any coding.
You can either set it up from the Designer (if you are using Visual Studio or #Develop) or do it via code. It is simple both ways. Lets do it!
Continue reading
C# – Check if Form is already running
To check if a form is already running you’ll have to look for it in the Application.OpenForms collection. When a form is opened it is added to that collection.
Here’s a boolean method that checks whether a form is open or not :
private bool CheckForm(Form form)
{
foreach (Form f in Application.OpenForms)
if (form == f)
return true;
return false;
}
Example use:
// if form2 is not running
if (!CheckForm(form2))
{
// do something
}
Thanks.
If you have any questions, don’t hesitate to post a comment.
C# Auto click button and auto fill form
This tutorial will show you how to auto fill forms and click buttons in a website using the webBrowser control. When you learn to do this you can make your own web bots!
To show you how autoclick/autofill works we’ll make a simple Google AutoSearch Bot.
So lets begin… Continue reading



