Tag: C#

Put application in startup

In this post I’ll show how you can put your application in Windows Startup using C#. One of the solutions to put yout application in Windows Startup is putting shortcut of your application in the startup folder of…

Read More »

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 »

.NET Action, Func, Delegate, Lambda expression in PowerShell

In this post I’ll explain what is the equivalent of C# Lambda expression in PowerShell and how you can define and use lambda expressions, Func or Action in PowerShell. Lambda Expression ↔ ScriptBlock We can consider PowerShell ScriptBlock…

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 »

Customize ASP.NET MVC Model Metadata

Using ASP.NET MVC, sometimes you want to customize metadata for model. For example you want to read display name from an XML file, or you want to set some additional metadata for example for rendering. In this post,…

Read More »

Add Property to ASP.NET Identity Role

In previous post, I showed you how to add property to Identity user. Another common requirement when using ASP.NET Identity is adding new property to IdentityRole. In this post I’ll share a step by step guide which is…

Read More »

Add Property to ASP.NET Identity User

One of the common requirements when using ASP.NET Identity, is adding new properties to the User entity. For example let’s say, we want to add a Code property to IdentityUser entity to store personnel code for the user….

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 »