Tag: Windows Forms

Panel titlebar – Customize nonclient area

In this example I’ve added a titlebar to the panel by extending the nonclient area of the panel and painting on the nonclient area. It basically means the titlebart is not part of the client rectangle and it…

Read More »

Panel border size and border color – Customize nonclient area

In this post, I’ll show you how you can customize the panel border size and border color by customizing the nonclient area of the panel. The following picture shows panels with different border color and border size: When…

Read More »

A Generic Type TypeConverter – Property Editor to pick a type

To push the property grid to show a dropdown for a property, usually the best way is creating a TypeConverter for the prioperty. It basically Provides a unified way of converting types of values to other types, as…

Read More »

Windows Forms HelpProvider – Add Unicode Support

The built-in HelpProvider component of windows forms is suffering from an old problem; it’s unable to show unicode characters (for example Persian language). Even if you try to show a help popup using Help.ShowPopup, when you a specify…

Read More »

DataAnnotations Attributes in Windows Forms

In a previous post, I showed how you can extend Windows Forms to use DataAnnotation Validation Attributes; Here in this post I am going to show how you can control DataGridView column name, column order, visibility, tooltip, control type, and format using DataAnnotation Attributes.

Read More »

Use COM type libraries in .NET CORE Windows Forms Project

In this post I’ll show how you can use COM type libraries in a .NET Core Windows Forms project. Sometimes you need to add a reference to a COM type library, for example, let’s say you want to…

Read More »

Print RDLC Report without Preview

Sometimes you have a report which you want to print without showing a preview in ReportViewer. You can print an RDLC report programmatically using LocalReport object and CreateStreamCallback callback function. There is an article in MSDN which describes…

Read More »

How to edit a List<string> in PropertyGrid

When you define a property of List<string> type for a control, if you try to edit the property in PropertyGrid, a collection editor form will open and if you click on add button on the editor form, you…

Read More »

How to add item to Windows shell context menu to open your application

Sometimes when installing applications, you want to add an entry to the windows shell context menu to open your application and pass the selected file or folder name to your application. In this post I’ll show how to…

Read More »

Enable designer of child Panel in a UserControl

Sometimes you want to create a composite user control and allow users to interact with the user control at designer when they drop an instance of your user control on a form. For example, let’s say we are…

Read More »