Category Archives: WinForm

Using single event handler for multiple control’s event in Windows Forms and ASP.NET using C#, VB.NET

Introduction: In this post I will explain how to use single event handler for click event of multiple Button controls in Windows Forms and ASP.NET using C# and VB.NET Description: Event handling in Windows Forms Create a new Windows Forms application and four buttons on the form, “btnAdd”, “btnSubtract”, “btnMultiply” and “btnDivide”. Write following event… Read More »

Adding dependencies to a setup project

In this article I will explain how add dependencies or prerequisites to a setup project Introduction A project we create may be dependent on some other software to work properly. We can add dependencies or prerequisites to these software components in our setup project to ensure availability of the required pre installation software. For example… Read More »

How to store user’s preferences in a Windows Forms application

Download Source Code In this post let’s see how to store user’s preferences in a Windows Forms application Introduction In this post we will see how to store user’s preferences in a Windows Forms application that persists even after closing the application. Here, we will give users an option to select font and background color… Read More »

How to play flash in Windows Forms application using C#

Download Source Code Introduction In this article we will see how to play a flash (.swf) file in Windows Forms application Description We have generally two methods for playing a flash animation in a Windows Forms application: Using COM component, Shockwave Flash Object Playing flash inside a WebBrowser control Method 1: Step 1: Create a… Read More »

How to generate random colors in C#

Introduction In an application I required to generate some random colors. Writing these colors manually was not easy. So I decided to use .NET Reflection to generate colors using System.Drawing.Color class Description We can use GetProperties method of Type class to get all the properties of Color class. It returns an array of PropertyInfo class.… Read More »

Text to Speech using C# in Windows Forms Application

In this post I will explain how to convert text to speech using C# in Windows Forms Application Download Source Code Introduction In this post we will see how to convert text to speech (TTS) using a built in Narrator installed in the system. We will use SpeechSynthesizer class of System.Speech library to built a… Read More »

How to get class information using .NET Reflection

In this article I will explain how to get properties, methods and events of class using .NET Reflection Download Introduction In this article we will see how to get class or type information of all the types inside System.Windows.Forms assembly. We will list all the properties, methods, and events of the selected class. We will… Read More »

Search a folder recursively in a Windows Forms application using C#

Download source code Introduction In this post I will explain how to search a folder recursively for some text and list all the files in the folder and its sub folders containing this text in a Windows Forms application using C# Description Step 1: Create a new Windows Forms application Step 2: Arrange controls on… Read More »

How to retrieve images from MySQL database and display as a slide show in Windows Forms application using C# and VB.NET

In this article I will explain how to retrieve images stored in BLOB field of MySQL database and display as a slide show in Windows Forms application using C# Download source code Introduction In previous article I explained how to save images in Windows Forms application using C#. In this article I will explain how… Read More »

How to save images in MySQL database using C# and VB.NET in Windows Forms application

Introduction In this article first we will create a table in MySQL database and then we will use a Windows Forms application to save image in the database Description Create a table in MySQL database using MySQL browser as following to store images For storing images you can use any of the BLOB (Binary Large… Read More »