Search

How to convert a dictionary to a list in C#
By Tan Lee Published on Dec 20, 2024 2.5K

In C#, dictionaries are commonly used to store key-value pairs, but sometimes, you might want to work with a list of these pairs instead of a dictionary.

Read more
C# Convert a list to a dictionary
By Tan Lee Published on Jan 21, 2025 424

The easiest way to convert a list into a dictionary is by using the LINQ ToDictionary() method.

Read more
How to add a Button each row in a DataGridView in C#
By Tan Lee Published on Jul 16, 2024 42.95K

To add a button to each row in a DataGridView in a C# Windows Forms application, you can follow these steps.

Read more
Face Detection for .NET using Emgu CV in C#
By Tan Lee Published on Jun 25, 2024 24.28K

To detect faces using Emgu CV (OpenCV wrapper for C#) in a Windows Forms Application, you can follow these steps.

Read more
Serialize a tuple to JSON in C#
By Tan Lee Published on Feb 05, 2025 608

When you serialize a tuple to JSON, the underlying ValueTuple field names, Item1 and Item2, are used. This is true even if you are using a named tuple. The field names you specify in the tuple declaration won't be reflected in the JSON.

Read more
How to check if a nullable bool is true in C#
By Tan Lee Published on Dec 24, 2024 552

In C#, nullable types allow you to represent data that can be absent or undefined, in addition to its usual valid values.

Read more
How to get application folder path in C#
By Tan Lee Published on Dec 05, 2024 1.1K

To get the application folder path in a .NET application, you can use the Server.MapPath() method in ASP.NET or AppDomain.CurrentDomain.BaseDirectory for other types of applications.

Read more
How to get the current working folder in C#
By Tan Lee Published on Nov 13, 2024 853

In C#, you can get the current working directory using the Directory.GetCurrentDirectory() method, which is part of the System.IO namespace.

Read more
Enum Generic Type Constraint in C#
By Tan Lee Published on Feb 04, 2025 461

In this post, let's look at how we can use Enum as a generic type constraint in C#. This feature was introduced in C# 7.3 and allows you to enforce that a type parameter is an enum, providing compile-time safety for your generic methods.

Read more
How to use Parallel.For and Parallel.ForEach in C#
By Tan Lee Published on Jan 06, 2025 1.03K

Parallel programming in .NET enables more efficient utilization of system resources and provides greater control over program execution.

Read more
How to Print Windows Form in C#
By Tan Lee Published on Jul 02, 2017 11.56K

To print a Windows Form in C#, you'll need to use the PrintDocument class along with the PrintPreviewDialog and PrintDialog to set up and manage the printing process.

Read more
How to fix 'This CKEditor 4.22.1 version is not secure. Consider upgrading to the latest one, 4.24.0-lts'
By Tan Lee Published on Aug 04, 2024 823

To address the warning about CKEditor 4.22.1 being outdated and insecure, you can follow these steps.

Read more
How to set up the Ezoic API for CDN Management
By Tan Lee Published on Feb 03, 2024 510

This example uses the Ezoic API to automatically purge pages from the ezoic CDN whenever your post or page is updated in c#.

Read more
How to use Lazy loading and Earger loading in Entity Framework
By Tan Lee Published on Feb 16, 2024 454

Entity Framework (EF) supports both lazy loading and eager loading to manage how related entities are loaded.

Read more
How to set DataSource for RDLC Report using Report Viewer in C#
By Tan Lee Published on Feb 16, 2024 1.48K

To set up a DataSource for a local report using the ReportViewer control in a C# Windows Forms application, you can follow these steps.

Read more
How to Create a Material Design Login Form in C#
By Tan Lee Published on Jul 16, 2024 37.77K

Creating a Material Design login form using MaterialSkin for Windows Forms involves several steps to set up the necessary components, styles, and functionality.

Read more
How to Insert Update Delete Search Records in C#
By Tan Lee Published on May 30, 2024 14.93K

To perform operations like Insert, Update, Delete, and Search on records displayed in a DataGridView in a C# Windows Forms application, you typically interact with a data source such as a database or a collection of objects.

Read more
How to Create User Registration Or Sign Up Form With SQL Server in C#
By Tan Lee Published on Jun 21, 2024 11.59K

Creating a user registration or sign-up form in a C# Windows Forms Application using SQL Server and Dapper ORM involves several steps.

Read more
How to make a PictureBox move in C#
By Tan Lee Published on Jun 25, 2024 14.17K

To make a PictureBox move with the mouse inside a Form in a C# Windows Forms Application, you'll need to handle the mouse events and update the PictureBox position accordingly.

Read more
How to use DarkUI in C#
By Tan Lee Published on Jun 24, 2024 5.83K

Using DarkUI in a C# Windows Forms Application involves several steps to set up and integrate the DarkUI controls into your project.

Read more