System windows forms contextmenustrip

Последнее обновление: 31.10.2015

ContextMenuStrip представляет контекстное меню. Данный компонент во многом аналогичен элементы MenuStrip за тем исключением,
что контекстное меню не может использоваться само по себе, оно обязательно применяется к какому-нибудь другому элементу, например,
текстовому полю.

Новые элементы в контекстное меню можно добавить в режиме дизайнера:

При этом мы можем добавить все те же элементы, что и в MenuStrip. Но, как правило, использует ToolStripMenuItem, либо элемент
ToolStripSeparator, представляющий горизонтальную полоску разделитель между другими пунктами меню.

Либо на панели свойств можно обратиться к свойству Items компонента ContextMenuStrip и в открывшемся окне добавить и настроить все элементы меню:

Теперь создадим небольшую программу. Добавим на форму элементы ContextMenuStrip и TextBox, которые будут иметь названия
contextMenuStrip1 и textBox1 соответственно. Затем изменим код формы следующим образом:

public partial class Form1 : Form
{
    string buffer;
    public Form1()
    {
        InitializeComponent();

        textBox1.Multiline = true;
        textBox1.Dock = DockStyle.Fill;

        // создаем элементы меню
        ToolStripMenuItem copyMenuItem = new ToolStripMenuItem("Копировать");
        ToolStripMenuItem pasteMenuItem = new ToolStripMenuItem("Вставить");
        // добавляем элементы в меню
        contextMenuStrip1.Items.AddRange(new[] { copyMenuItem, pasteMenuItem });
        // ассоциируем контекстное меню с текстовым полем
        textBox1.ContextMenuStrip = contextMenuStrip1;
        // устанавливаем обработчики событий для меню
        copyMenuItem.Click += copyMenuItem_Click;
        pasteMenuItem.Click += pasteMenuItem_Click;
    }
	// вставка текста
    void pasteMenuItem_Click(object sender, EventArgs e)
    {
        textBox1.Paste(buffer);
    }
	// копирование текста
    void copyMenuItem_Click(object sender, EventArgs e)
    {
        // если выделен текст в текстовом поле, то копируем его в буфер
        buffer = textBox1.SelectedText;
    }
}

В данном случае выполнена простейшая реализация функциональности copy-paste. В меню добавляется два элемента. А у текстового поля устанавливается
многострочность, и оно растягивается по ширине контейнера.

У многих компонентов есть свойство ContextMenuStrip, которое позволяет ассоциировать контекстное меню с данным элементом.
В случае с TextBox ассоциация происходит следующим образом: textBox1.ContextMenuStrip = contextMenuStrip1.
И по нажатию на текстовое поле правой кнопкой мыши мы сможем вызвать ассоциированное контекстное меню.

С помощью обработчиков нажатия пунктов меню устанавливаются действия по копированию и вставке строк.

You currently have JavaScript disabled on your web browser.

This website uses JavaScript, and This web page needs JavaScript activated to work correctly.

Please active JavaScript on your web browser and then refresh this web page.

ContextMenuStrip

By Tim-Bo Tolbert, posted on Dec 27, 2021

The ContextMenuStrip control component is found in the System.Windows.Forms namespace within the System.Windows.Forms.dll. In this blog post I am referring to the ContextMenuStrip control that is available in C# .NET-Core (.NET 6.0) with Visual Studio 2022 (although this code example might still work OK with older .NET versions).

The ContextMenuStrip component represents a shortcut menu, which appears as a temporary popup menu whenever a user right mouse clicks onto an object which is bound to a ContextMenuStrip component. The ContextMenuStrip component replaces its predecessor the ContextMenu component of previous versions, even though the ContextMenu object is still retained in .NET for both backward and forward compatibility. The ContextMenuStrip component inherits a lot from the ToolStrip object, and as such the definitions may refer to it often in an attempt to relate to specific components of the object.

The ContextMenuStrip component can be associated with and bound to any control, both at design time and at run time, including the Form itself, which will display the shortcut menu upon a right mouse click on that control. You can also show a ContextMenuStrip programmatically by using the Show method.

Cancelable Opening and Closing events to handle dynamic population and multiple-click scenarios are supported by the ContextMenuStrip component.

The ContextMenuStrip component also supports images, menu-item check states, text, access keys, shortcuts, and cascading menus.

Set the ContextMenuStrip’s ShowCheckMargin property to True to add space to the left of a MenuItem for a check mark that shows that the menu item is enabled or selected. The ShowImageMargin property is set to True by default, which adds a space to the left of the MenuItem to display an image for that menu item.

Example Source Code

This example uses a ContextMenuStrip component, along with a CheckBox control.

To add the ContextMenuStrip component to your form, you can double click on its name (i.e. ContextMenuStrip) as listed in the Toolbox window panel within the Form editor window. Alternatively, you can single click on it and then drag and drop it onto your form. Once it is added, it will appear in a window located below the form, since it has no user interface and will not actually appear on the form itself, except during design time.

Once it is added, then you can select it in the Form editor, and then either add menu items to it from the Form Editor window and/or by its Items property within the Property window. You can also view and adjust all of its other property values in the Properties window.

In the example below, I added a ContextMenuStrip to the Form, then selected it and viewed its Items properties in the Property window to add three menu items to its Items collection, and set their Text property values to be «Checked», «Unchecked», and «Indeterminate». I then double clicked onto each of the menu items to auto create and link their Click events to callback methods. I then added a CheckBox control to the form, and altered its properties so that it can have three states (checked, unchecked, and indeterminate) instead of its default two (checked and unchecked), as well as its Text and position property values as shown below. I then set the CheckBox’s context menu strip property to bind it to the ContextMenuStrip component that I had added to the form. I then modified the source code for each of the three callback methods to set the CheckBox components checked state accordingly, based on which callback method is called:

example1

example3

example4

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TestProgram
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        void Form1_Load(object sender, EventArgs e)
        {
            // 
        }

        private void checkedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // set CheckBox state to Checked
            checkBox1.CheckState = CheckState.Checked;
        }

        private void uncheckedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // set CheckBox state to Unchecked
            checkBox1.CheckState = CheckState.Unchecked;
        }

        private void indeterminateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // set CheckBox state to Indeterminate
            checkBox1.CheckState = CheckState.Indeterminate;
        }
    }
}

When you run the above example, and then if you Right Mouse Click onto the CheckBox’s text, then you should see a popup menu appear which will allow you to set the CheckBox’s checked state by clicking on one of its menu items, similar to the following:


Final Thoughts

Thank you for reading, I hope you found this blog post (tutorial) educational and helpful.

This page has been viewed a total of 3383 times.

How to Add Right Click Menu to an Item in C#

This article will discuss adding a right-click menu to an item in a C# windows form.

Follow the below steps to add a ContextMenuStrip into windows form and to add its item.

  • Open Visual Studio and create or open an existing Windows Form project.
  • Go to View > ToolBox and enter ContextMenuStrip in search of ToolBox.
  • Now, right-click on the ContextMenuStrip and click on the properties.

    Context Menu Properties

  • In the right-down properties panel, find Items and click on the three-dot option.

    Find Items in properties panel

  • Now, click the Add button to add items, as I added three items below.

    Add Items in the Context Menu

  • Create items Events by double-clicking on each item.

  • Right click on Windows form > properties and set ContextMenuStrip property as contextMenuStrip1.

    Set ContextMenuStrip Properties

  • After creating events where you’ll write your logic, I’ll leave it blank so you can write your code here.
    private void toolStripMenuItem1_Click(object sender, EventArgs e) {}
    private void toolStripMenuItem2_Click(object sender, EventArgs e) {}
    private void exitToolStripMenuItem_Click(object sender, EventArgs e) {}
    

Window Form Source Code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RightClickItemByZeeshan {
  public partial class Form1 : Form {
    public Form1() {
      InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e) {}

    private void toolStripMenuItem1_Click(object sender, EventArgs e) {}

    private void toolStripMenuItem2_Click(object sender, EventArgs e) {}

    private void exitToolStripMenuItem_Click(object sender, EventArgs e) {
      Application.Exit();
    }
  }
}

Output:

Add Right Click Menu to an Item

Enjoying our tutorials? Subscribe to DelftStack on YouTube to support us in creating more high-quality video guides. Subscribe

Muhammad Zeeshan avatar

Muhammad Zeeshan avatar

I have been working as a Flutter app developer for a year now. Firebase and SQLite have been crucial in the development of my android apps. I have experience with C#, Windows Form Based C#, C, Java, PHP on WampServer, and HTML/CSS on MYSQL, and I have authored articles on their theory and issue solving. I’m a senior in an undergraduate program for a bachelor’s degree in Information Technology.

LinkedIn

Related Article — Csharp GUI

  • How to Save File Dialog in C#
  • How to Group the Radio Buttons in C#
  • How to Add Items in C# ComboBox
  • How to Add Placeholder to a Textbox in C#
  • How to Simulate a Key Press in C#

  • Print
Details
Written by David Corrales
Last Updated: 14 December 2016
Created: 16 December 2011
Hits: 42415

ContextMenuStrip [System.Windows.Forms.ContextMenuStrip]

Represents a shortcut menu.

Default Event: Opening

Why use a ContextMenuStrip control?

Use the ContextMenuStrip when you want to display a menu of commands when the user right clicks on a specific control.

Adding a ContextMenuStrip to a control:

For your convenience, when you drop a ContextMenuStrip in the designer, PowerShell Studio will automatically assign the ContextMenuStrip to any control you drop it on.

To manually assign a ContextMenuStrip to a control, you need to set the control’s ContextMenuStrip property to the desired ContextMenuStrip control. Note: Not all controls have a ContextMenuStrip property, but the majority do. 

You can assign a ContextMenuStrip to a control by using the Property Pane:

Or you can also assign a ContextMenuStrip using the Script Editor:

$treeviewServices.ContextMenuStrip = $contextmenustripService

Refer to the Show method example below to see how to manually display a context menu. 

Important Properties:

ShowCheckMargin

This property gets or sets a value indicating whether space for a check mark is shown on the left edge of the ToolStripMenuItem.

Default Value: False

If the ShowcheckMargin is set to False and there is no image set, the check mark will display in the image location.

ShowImageMargin

This property gets or sets a value indicating whether space for an image is shown on the left edge of the ToolStripMenuItem.

Default Value: True

Image Margin Displayed:

Image Margin Hidden:

ShowItemToolTips

This property gets or sets a value indicating whether ToolTips are to be displayed on ToolStrip items.

Default Value: False

When this property is set to True, the tooltips set on each menu item will be displayed when the mouse hovers over it.

SourceControl

This property returns the last control that caused the ContextMenuStrip to display.

Items

This property contains all the menu items that belong to a ContextMenuStrip.

Adding Menu Items:

The designer offers two ways of editing and adding menu items to your context menu.

1) Edit the ContextMenuStrip directly in the designer

Select the added ContextMenuStrip at the bottom of the designer:

Once you’ve selected the ContextMenuStrip, a menu strip will be displayed directly in the designer, allowing you to visually add and remove menu items.

Note: You can edit the menu item’s properties using the Property Pane.

2) Using the MenuItem Editor

The editor can be accessed via the Property Pane:

Or using the quick access menu in the designer:

Edit Items in Designer

The Menu Item Collection Editor allows you to add and remove MenuItems and access the properties at the same time.

There are different types of menu items you can add to your context menu. 

Types of Menu Items:

MenuItem – Is a selectable option displayed on a ContextMenuStrip. It is the general purpose read only menu item which supports sub menu items.

Properties Description
Image The image that will be displayed next to the menu item.
Checked Indicates whether the menu item is in the checked state
CheckState Indicates the state of the menu item.

Values (Default Value: Unchecked):
Unchecked  –

Checked

Indeterminate

CheckOnClick Indicates whether the item should toggle its selected state when clicked.
DropDownMenuItems Specifies a submenu to display when the item is clicked. Functions similar to the ContextMenuStrip’s items property.
ShortcutKeys The shortcut key associated with the menu item. This is a quick way of assigning a short cut key to a command.
Text The text displayed on the menu item.
Visible Determines whether the menu item is visible or hidden.
Events Description
Click This event occurs when the MenuItem is clicked. Use this event to process the menu command. You can also use the ContextMenuStrip’s ItemClicked event as an alternative.
CheckedChanged This event occurs whenever the Check property is changed. Use this event to react to the check change as it occurs.
CheckStateChanged The event occurs whenever the CheckState property is changed. Use this event to react to the check state change as it occurs.

ComboBox – Displays a combo box on a ContextMenuStrip. The combo box menu item behaves like the traditional ComboBox control. See the Spotlight on the ComboBox Control article for more details.

Properties Description
Items This property contains a collection of items that are displayed in the combo box.
Event Description
SelectedIndexChanged This event occurs when the value of the SelectedIndex property has changed. Use this event to react to the selection change as it occurs.

TextBox – Displays a text box in a ContextMenuStrip which allows the user to enter text. The text box menu item behaves like the traditional TextBox control. See the Spotlight on the TextBox Control article for more details.

Properties Description
Text This property contains the text that is displayed in the text box.
Event Description
TextChanged This event occurs when the value of the Text property changes. Use this event to react to the selection change as it occurs.

Separator -Represents a static line used to group the drop-down items of the ContextMenuStrip control.

Adding Menu Items Dynamically:

Typically you will add menu items via the designer, but there are times when you may want to add a menu item dynamically via the script editor.

#Add a new menu Item
$contextmenustripService.Items.Add('New Menu Item')

#Add a Separator
$contextmenustripService.Items.Add('-')

#Add a combo box item
$comboBoxMenuItem = New-Object System.Windows.Forms.ToolStripComboBox
$comboBoxMenuItem.Items.Add('Option 1')
$comboBoxMenuItem.Items.Add('Option 2')
$contextmenustripService.Items.Add($comboBoxMenuItem)

#Add a text box item
$textBoxMenuItem = New-Object System.Windows.Forms.ToolStripTextBox
$textBoxMenuItem.Text = 'Default Text'
$contextmenustripService.Items.Add($textBoxMenuItem)

Important Events:

ItemClicked

This event occurs when a menu item is clicked. Use this event as a general catch all event for the menu items. It allows you to react to the menu item clicks without having to set each individual menu item’s click event.

You can access the clicked item by accessing the event’s argument ClickItem property:

$_.ClickedItem

The following is an example of how to respond to the ItemClicked event:

$contextmenustripService_ItemClicked=[System.Windows.Forms.ToolStripItemClickedEventHandler]{
#Event Argument: $_ = [System.Windows.Forms.ToolStripItemClickedEventArgs]

    if($_.ClickedItem -eq $startToolStripMenuItem)
    {
        Write-Host 'Start'
    }
    elseif ($_.ClickedItem.Text -eq 'Stop')
    {
        Write-Host 'Stop'
    }
}

Opening

This event occurs when the ContextMenuStrip is opening. Use this event as a trigger to initialize the menu items such as enabling / disabling or hiding menu items.

You can prevent the ContextMenuStrip from opening by cancelling the event:

$_.Cancel = $true

The following is an example demonstrating the use of the Opening event to initialize the menu items:

$contextmenustripService_Opening=[System.ComponentModel.CancelEventHandler]{
#Event Argument: $_ = [System.ComponentModel.CancelEventArgs]

    $pauseToolStripMenuItem.Enabled = $false
    $startToolStripMenuItem.Enabled = $false
    $stopToolStripMenuItem.Enabled = $false
    
    if($treeviewServices.SelectedNode -ne $null)
    {
        $service = $treeviewServices.SelectedNode.Tag
    
        if($service -ne $null)#Is there is a service object?
        {
            $pauseToolStripMenuItem.Enabled = $false
            $startToolStripMenuItem.Enabled = $false
            $stopToolStripMenuItem.Enabled = $false
            
            $service.Refresh() #Update the status
        
            if($service.Status -eq 'Running')
            {
                $stopToolStripMenuItem.Enabled = $true
                $pauseToolStripMenuItem.Enabled = $service.CanPauseAndContinue
            }
            elseif($service.Status -eq 'Paused')
            {
                $startToolStripMenuItem.Enabled = $true
                $stopToolStripMenuItem.Enabled = $true
            }
            else
            {
                $startToolStripMenuItem.Enabled = $true
            }
        }
    }
    else
    {
        $_.Cancel = $true   #Don’t show the context menu
    }
    
}

Closed

This event occurs when the ContextMenuStrip has closed. You can use this event to handle state changes or selection changes in a combo box menu item if you do not handle their state changes as they occur.

To determine why the ContextMenuStrip closed, you can access the event’s argument CloseReason property:

$_.CloseReason

Values:

AppFocusChange
Specifies that the ContextMenuStrip control was closed because another application has received the focus.

AppClicked
Specifies that the ContextMenuStrip control was closed because an application was launched.

ItemClicked
Specifies that the ContextMenuStrip control was closed because one of its items was clicked.

Keyboard
Specifies that the ContextMenuStrip control was closed because of keyboard activity, such as the ESC key being pressed.

CloseCalled
Specifies that the ContextMenuStrip control was closed because the Close method was called.

Example use of the Closed event:

$contextmenustripService_Closed=[System.Windows.Forms.ToolStripDropDownClosedEventHandler]{
#Event Argument: $_ = [System.Windows.Forms.ToolStripDropDownClosedEventArgs]
    Write-Host "Close Reason: $($_.CloseReason)"
    
    if($_.CloseReason -eq 'ItemClicked')
    {
        Write-Host 'ComboBox Value: ' $comboBoxMenuItem.SelectedText
        Write-Host 'TextBox Value: ' $textBoxMenuItem.Text
    }
}

Important Methods:

Close

This method closes the ContextMenuStrip control.

$contextmenustripService.Close()

Show

This method  displays the context menu. Use this method when you wish to manually trigger the context menu.

Example use of the Show method:

$treeviewServices_NodeMouseClick=[System.Windows.Forms.TreeNodeMouseClickEventHandler]{
#Event Argument: $_ = [System.Windows.Forms.TreeNodeMouseClickEventArgs]
    if($_.Button -eq 'Right')
    {
        $treeviewServices.SelectedNode = $_.Node
        
        #Display a context menu for any node without setting
        #each individual contextmenustrip property
        
        #Show the context menu relative to a control
        $contextmenustripService.Show($treeviewServices, $_.Location)
        
        #Alternative: Show context menu using a screen location
        #$truePoint = $treeviewServices.PointToScreen($_.Location)
        #$contextmenustripService.Show($truePoint)
    }
}

In the example above, the context menu is displayed whenever a user right clicks on a node in the TreeView control.

You can download the ContextMenuStrip example. This sample builds upon the Spotlight on the TreeView Control example.

<< Back to C-SHARP

Use the ContextMenuStrip control from Windows Forms. Handle the Opening event.

ContextMenuStrip. This enhances usability in programs. Context menus should appear when a user right-clicks, reacting to the surroundings.

Steps. We see the steps to create a ContextMenuStrip. Use ContextMenuStrip to create a custom menu on right-click events. It usually includes Copy, Cut and Paste.

Start: Here we show how to create ContextMenuStrip controls in your Windows Forms program.

TextBox: For the example, you may have a TextBox on the form, which you can name anything you want. We will call it textBox1 in this guide.

Look at the Toolbox, which is usually a tab or panel on the left. Click on the Menus & Toolbars heading, and you will see a list of items. Next select the ContextMenuStrip item.

Then: Double-click on the ContextMenuStrip item and then enter some text such as «Copy» in the gray box in the context menu.

Each Windows Forms control has a ContextMenuStrip property. The Visual Studio Designer view allows us to visually set those properties, without code statements.

Step 1. Click on the TextBox, textBox1, you may have on your form. On the right side of your Visual Studio window, you may have a Properties pane. Look at the entries of this pane.

Step 2. Select the ContextMenuStrip property. There are buttons near the top, and you can select the A-Z listing. In the A-Z listing, you will see an alphabetized list of properties.

Click. We need to make the context menu actually do something. Here we make it perform a Copy on textBox1 when the user clicks on it.

Next: Go ahead and double click on your custom menu item, which will create an event handler that looks like this.

Code that implements Click event: C#

private void copyToolStripMenuItem1_Click(object sender, EventArgs e)
{
// Here, add the copy command to the relevant control, such as…
textBox1.Copy(); // Added manually.
}

Open. You need to click on the ContextMenu and then look at Properties pane on the right. Then click on the lightning bolt in Properties pane.

Finally: Scroll down to Opening and double-click in the user interface to the right of Opening.

And: You will see this block of code appear. It is generated by the Visual Studio environment.

Code that implements Opening event: C#

private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
// Runs before the user sees anything.
// A great place to set Enabled to true or false.
}

Adding to event. Here we change the contents of the event handler. We can set the Copy menu item as Enabled when the selection is present, and disabled when there is no selection.

More detailed opening event handler: C#

private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
// An elegant way to make the ContextMenu item always be Enabled
// when there is a selection, and always disabled when there isn’t.
copyToolStripMenuItem1.Enabled = textBox1.SelectionLength > 0;
}

We saw a way to disable the context menu’s items depending on other factors in the UI. You won’t need to manage the ToolStripMenuItem objects in any other way.

When text is selected, the Copy menu item is enabled. This approach is reliable and easy to understand. ContextMenuStrip is a useful control.

Related Links:

  • C# Array Examples, String Arrays
  • C# ArrayList Examples
  • C# ArraySegment: Get Array Range, Offset and Count
  • C# break Statement
  • C# Buffer BlockCopy Example
  • C# BufferedStream: Optimize Read and Write
  • 404 Not Found
  • C# 24 Hour Time Formats
  • C# 2D Array Examples
  • 7 Zip Command Line Examples
  • C# 7 Zip Executable (Process.Start)
  • C# All Method: All Elements Match a Condition
  • C# Alphabetize String
  • C# Alphanumeric Sorting
  • C# Arithmetic Expression Optimization
  • C# Array.AsReadOnly Method (ObjectModel)
  • C# Array.BinarySearch Method
  • C# Array.Clear Examples
  • C# Array.IndexOf, LastIndexOf: Search Arrays
  • C# async, await Examples
  • C# Attribute Examples
  • C# Average Method
  • C# BackgroundWorker
  • C# base Keyword
  • C# String Between, Before, After
  • C# Binary Representation int (Convert, toBase 2)
  • C# BinarySearch List
  • C# bool Array (Memory Usage, One Byte Per Element)
  • C# bool.Parse, TryParse: Convert String to Bool
  • C# bool Type
  • C# Array Length Property, Get Size of Array
  • C# Button Example
  • C# Byte Array: Memory Usage, Read All Bytes
  • C# Byte and sbyte Types
  • C# Capacity for List, Dictionary
  • C# Case Insensitive Dictionary
  • C# case Example (Switch Case)
  • C# Char Array
  • C# Checked and Unchecked Keywords
  • C# CheckedListBox: Windows Forms
  • C# Color Table
  • C# Color Examples: FromKnownColor, FromName
  • C# ColorDialog Example
  • C# Comment: Single Line and Multiline
  • C# Concat Extension: Combine Lists and Arrays
  • C# Conditional Attribute
  • C# Console Color, Text and BackgroundColor
  • C# String Clone() method
  • C# Constructor Examples
  • C# Contains Extension Method
  • C# String GetTypeCode() method
  • C# String ToLowerInvariant() method
  • C# Customized Dialog Box
  • C# DataColumn Example: Columns.Add
  • C# DataGridView Add Rows
  • DataGridView Columns, Edit Columns Dialog
  • C# DataGridView Row Colors (Alternating)
  • C# DataGridView Tutorial
  • C# DataGridView
  • C# DataRow Examples
  • C# DataSet Examples
  • C# DataSource Example
  • C# DataTable Compare Rows
  • C# DataTable foreach Loop
  • C# DataTable RowChanged Example: AcceptChanges
  • C# DataTable Select Example
  • C# DataTable Examples
  • C# DataView Examples
  • C# String ToString() method
  • C# String ToUpper() method
  • C# Digit Separator
  • C# DateTime.MinValue (Null DateTime)
  • C# DateTime.Month Property
  • C# DateTime.Parse: Convert String to DateTime
  • C# DateTime Subtract Method
  • C# Decompress GZIP
  • C# Remove Duplicates From List
  • C# dynamic Keyword
  • C# ElementAt, ElementAtOrDefault Use
  • C# Encapsulate Field
  • C# Enum Array Example, Use Enum as Array Index
  • C# enum Flags Attribute Examples
  • C# Enum ToString: Convert Enum to String
  • C# enum Examples
  • C# Enumerable.Range, Repeat and Empty
  • C# Environment Type
  • C# EventLog Example
  • C# Exception Handling
  • C# explicit and implicit Keywords
  • C# Factory Design Pattern
  • C# File.Copy Examples
  • C# typeof and nameof Operators
  • C# String TrimEnd() method
  • C# var Examples
  • C# virtual Keyword
  • C# void Method, Return No Value
  • C# volatile Example
  • C# WebBrowser Control (Navigate Method)
  • C# WebClient: DownloadData, Headers
  • C# Where Method and Keyword
  • C# String TrimStart() method
  • C# delegate Keyword
  • C# descending, ascending Keywords
  • C# while Loop Examples
  • C# Whitespace Methods: Convert UNIX, Windows Newlines
  • C# XmlReader, Parse XML File
  • C# XmlTextReader
  • C# XmlTextWriter
  • C# XmlWriter, Create XML File
  • C# XOR Operator (Bitwise)
  • C# yield Example
  • C# float Numbers
  • FlowLayoutPanel Control
  • C# Focused Property
  • C# FolderBrowserDialog Control
  • C# Font Type: FontFamily and FontStyle
  • C# FontDialog Example
  • C# for Loop Examples
  • C# foreach Loop Examples
  • ForeColor, BackColor: Windows Forms
  • C# Form: Event Handlers
  • C# Contains String Method
  • C# ContainsValue Method (Value Exists in Dictionary)
  • C# ContextMenuStrip Example
  • C# continue Keyword
  • C# Control: Windows Forms
  • C# Windows Forms Controls
  • C# Convert Char Array to String
  • C# Convert Char to String
  • C# Convert Days to Months
  • C# Convert String to Byte Array
  • C# String Format
  • C# Func Object (Lambda That Returns a Value)
  • C# GC.Collect Examples: CollectionCount, GetTotalMemory
  • C# Path.GetDirectoryName (Remove File From Path)
  • C# goto Examples
  • C# HttpClient Example: System.Net.Http
  • ASP.NET HttpContext Request Property
  • IL Disassembler Tutorial
  • C# Intermediate Language (IL)
  • C# IndexOf Examples
  • C# IndexOfAny Examples
  • C# Initialize Array
  • C# Initialize List
  • C# InitializeComponent Method: Windows Forms
  • C# Inline Optimization
  • C# Dictionary Equals: If Contents Are the Same
  • C# Dictionary Versus List Loop
  • C# Dictionary Order, Use Keys Added Last
  • C# Dictionary Size and Performance
  • C# Dictionary Versus List Lookup Time
  • C# Dictionary Examples
  • C# Get Directory Size (Total Bytes in All Files)
  • C# Directory Type
  • C# Distinct Method, Get Unique Elements Only
  • C# Divide by Powers of Two (Bitwise Shift)
  • C# Divide Numbers (Cast Ints)
  • C# DomainUpDown Control Example
  • C# Double Type: double.MaxValue, double.Parse
  • C# Remove Duplicate Chars
  • C# IEqualityComparer
  • C# If Preprocessing Directive: Elif and Endif
  • C# If Versus Switch Performance
  • C# if Statement
  • C# int.MaxValue, MinValue (Get Lowest Number)
  • C# Program to reverse number
  • C# Int and uint Types
  • C# Integer Append Optimization
  • C# Keywords
  • C# Label Example: Windows Forms
  • C# Lambda Expressions
  • C# LastIndexOf Examples
  • C# Last, LastOrDefault Methods
  • C# Mutex Example (OpenExisting)
  • C# Named Parameters
  • C# Let Keyword (Use Variable in Query Expression)
  • C# Levenshtein Distance
  • C# LinkLabel Example: Windows Forms
  • C# LINQ
  • C# List Add Method, Append Element to List
  • C# List AddRange, InsertRange (Append Array to List)
  • C# List Clear Example
  • C# List Contains Method
  • C# List Remove Examples
  • C# List Examples
  • C# ListBox Tutorial (DataSource, SelectedIndex)
  • C# ListView Tutorial: Windows Forms
  • C# Maze Pathfinding Algorithm
  • C# Memoization
  • C# Memory Usage for Arrays of Objects
  • C# MessageBox.Show Examples
  • C# Method Call Depth Performance
  • C# Method Parameter Performance
  • C# Method Size Optimization
  • C# Multidimensional Array
  • C# MultiMap Class (Dictionary of Lists)
  • C# Optimization
  • C# new Keyword
  • C# NotifyIcon: Windows Forms
  • C# NotImplementedException
  • C# Null Array
  • C# String GetType() method
  • C# Null Coalescing and Null Conditional Operators
  • C# Null List (NullReferenceException)
  • C# Numeric Casts
  • C# NumericUpDown Control: Windows Forms
  • C# object.ReferenceEquals Method
  • C# Object Examples
  • C# Optional Parameters
  • C# Prime Number
  • C# OrderBy, OrderByDescending Examples
  • C# Process Examples (Process.Start)
  • Panel, Windows Forms (Create Group of Controls)
  • C# Path Examples
  • C# Get Percentage From Number With Format String
  • ASP.NET PhysicalApplicationPath
  • C# PictureBox: Windows Forms
  • C# PNG Optimization
  • C# Position Windows: Use WorkingArea and Location
  • Visual Studio Post Build, Pre Build Macros
  • C# ProfileOptimization
  • C# ProgressBar Example
  • C# Property Examples
  • C# PropertyGrid: Windows Forms
  • C# Protected and internal Keywords
  • C# Public and private Methods
  • C# Remove Punctuation From String
  • C# Query Windows Forms (Controls.OfType)
  • C# Queryable: IQueryable Interface and AsQueryable
  • ASP.NET QueryString Examples
  • C# Queue Collection: Enqueue
  • C# RadioButton Use: Windows Forms
  • C# ReadOnlyCollection Use (ObjectModel)
  • C# Recursion Optimization
  • C# Recursive File List: GetFiles With AllDirectories
  • C# ref Keyword
  • C# Reflection Examples
  • C# Regex.Escape and Unescape Methods
  • C# StringBuilder Examples
  • C# StringComparison and StringComparer
  • C# StringReader Class (Get Parts of Strings)
  • C# String GetEnumerator() method
  • C# String GetHashCode() method
  • C# Regex Versus Loop: Use For Loop Instead of Regex
  • C# Regex.Match Examples: Regular Expressions
  • C# RemoveAll: Use Lambda to Delete From List
  • C# Replace String Examples
  • ASP.NET Response.BinaryWrite
  • ASP.NET Response.Write
  • C# Return Optimization: out Performance
  • C# SaveFileDialog: Use ShowDialog and FileName
  • C# Scraping HTML Links
  • C# sealed Keyword
  • C# Seek File Examples: ReadBytes
  • C# select new Example: LINQ
  • C# Select Method (Use Lambda to Modify Elements)
  • C# Serialize List (Write to File With BinaryFormatter)
  • C# Settings.settings in Visual Studio
  • C# Shuffle Array: KeyValuePair and List
  • C# Single and Double Types
  • C# Single Instance Windows Form
  • C# Snippet Examples
  • C# Sort DateTime List
  • C# Sort List With Lambda, Comparison Method
  • C# Sort Number Strings
  • C# Sort Examples: Arrays and Lists
  • C# SortedDictionary
  • C# SortedList
  • C# SortedSet Examples
  • C# Split String Examples
  • C# String Copy() method
  • C# SplitContainer: Windows Forms
  • C# SqlClient Tutorial: SqlConnection, SqlCommand
  • C# SqlCommand Example: SELECT TOP, ORDER BY
  • C# SqlCommandBuilder Example: GetInsertCommand
  • C# SqlConnection Example: Using, SqlCommand
  • C# SqlDataAdapter Example
  • C# SqlDataReader: GetInt32, GetString
  • C# SqlParameter Example: Constructor, Add
  • C# Stack Collection: Push, Pop
  • C# Static List: Global List Variable
  • C# Static Regex
  • C# Static String
  • C# static Keyword
  • C# StatusStrip Example: Windows Forms
  • C# String Chars (Get Char at Index)
  • C# string.Concat Examples
  • C# String Interpolation Examples
  • C# string.Join Examples
  • C# String Performance, Memory Usage Info
  • C# String Property
  • C# String Slice, Get Substring Between Indexes
  • C# String Switch Examples
  • C# String
  • C# StringBuilder Append Performance
  • C# StringBuilder Cache
  • C# ToBase64String (Data URI Image)
  • C# Struct Versus Class
  • C# struct Examples
  • C# Substring Examples
  • C# Numeric Suffix Examples
  • C# switch Examples
  • C# String IsNormalized() method
  • C# TabControl: Windows Forms
  • TableLayoutPanel: Windows Forms
  • C# Take and TakeWhile Examples
  • C# Task Examples (Task.Run, ContinueWith and Wait)
  • C# Ternary Operator
  • C# Text Property: Windows Forms
  • C# TextBox.AppendText Method
  • C# TextBox Example
  • C# TextChanged Event
  • C# TextFieldParser Examples: Read CSV
  • C# ThreadStart and ParameterizedThreadStart
  • C# throw Keyword Examples
  • C# Timer Examples
  • C# TimeSpan Examples
  • C# TrimEnd and TrimStart
  • C# True and False
  • C# Truncate String
  • C# String ToLower() method
  • C# String ToCharArray() method
  • C# String ToUpperInvariant() method
  • C# String Trim() method
  • C# Assign Variables Optimization
  • C# Array.Resize Examples
  • C# Array.Sort: Keys, Values and Ranges
  • C# Array.Reverse Example
  • C# Array Slice, Get Elements Between Indexes
  • C# Array.TrueForAll: Use Lambda to Test All Elements
  • C# ArrayTypeMismatchException
  • C# as: Cast Examples
  • C# ASCII Table
  • C# ASCII Transformation, Convert Char to Index
  • C# AsEnumerable Method
  • C# AsParallel Example
  • ASP.NET AspLiteral
  • C# BaseStream Property
  • C# Console.Beep Example
  • C# Benchmark
  • C# BinaryReader Example (Use ReadInt32)
  • C# BinaryWriter Type
  • C# BitArray Examples
  • C# BitConverter Examples
  • C# Bitcount Examples
  • C# Bool Methods, Return True and False
  • C# bool Sort Examples (True to False)
  • C# Caesar Cipher
  • C# Cast Extension: System.Linq
  • C# Cast to Int (Convert Double to Int)
  • C# Cast Examples
  • C# catch Examples
  • C# Change Characters in String (ToCharArray, For Loop)
  • C# Char Combine: Get String From Chars
  • C# char.IsDigit (If Char Is Between 0 and 9)
  • C# char.IsLower and IsUpper
  • C# Character Literal (const char)
  • C# Char Lowercase Optimization
  • C# Char Test (If Char in String Equals a Value)
  • C# char.ToLower and ToUpper
  • C# char Examples
  • C# abstract Keyword
  • C# Action Object (Lambda That Returns Void)
  • C# Aggregate: Use Lambda to Accumulate Value
  • C# AggressiveInlining: MethodImpl Attribute
  • C# Anagram Method
  • C# And Bitwise Operator
  • C# Anonymous Function (Delegate With No Name)
  • C# Any Method, Returns True If Match Exists
  • C# StringBuilder Append and AppendLine
  • C# StringBuilder AppendFormat
  • ASP.NET appSettings Example
  • C# ArgumentException: Invalid Arguments
  • C# Array.ConvertAll, Change Type of Elements
  • C# Array.Copy Examples
  • C# Array.CreateInstance Method
  • C# Array and Dictionary Test, Integer Lookups
  • C# Array.Exists Method, Search Arrays
  • C# Array.Find Examples, Search Array With Lambda
  • C# Array.ForEach: Use Lambda on Every Element
  • C# Array Versus List Memory Usage
  • C# Array Property, Return Empty Array
  • C# CharEnumerator
  • C# Chart, Windows Forms (Series and Points)
  • C# CheckBox: Windows Forms
  • C# class Examples
  • C# Clear Dictionary: Remove All Keys
  • C# Clone Examples: ICloneable Interface
  • C# Closest Date (Find Dates Nearest in Time)
  • C# Combine Arrays: List, Array.Copy and Buffer.BlockCopy
  • C# Combine Dictionary Keys
  • C# ComboBox: Windows Forms
  • C# CompareTo Int Method
  • C# Comparison Object, Used With Array.Sort
  • C# Compress Data: GZIP
  • C# Console.Read Method
  • C# Console.ReadKey Example
  • C# Console.ReadLine Example (While Loop)
  • C# Console.SetOut and Console.SetIn
  • C# Console.WindowHeight
  • C# Console.Write, Append With No Newline
  • C# Console.WriteLine (Print)
  • C# const Example
  • C# Constraint Puzzle Solver
  • C# Count Characters in String
  • C# Count, Dictionary (Get Number of Keys)
  • C# Count Letter Frequencies
  • C# Count Extension Method: Use Lambda to Count
  • C# CSV Methods (Parse and Segment)
  • C# DataRow Field Method: Cast DataTable Cell
  • C# Get Day Count Elapsed From DateTime
  • C# DateTime Format
  • C# DateTime.Now (Current Time)
  • C# DateTime.Today (Current Day With Zero Time)
  • C# DateTime.TryParse and TryParseExact
  • C# DateTime Examples
  • C# DateTimePicker Example
  • C# Debug.Write Examples
  • C# Visual Studio Debugging Tutorial
  • C# decimal Examples
  • C# DayOfWeek
  • C# Enum.Format Method (typeof Enum)
  • C# Enum.GetName, GetNames: Get String Array From Enum
  • C# Enum.Parse, TryParse: Convert String to Enum
  • C# Error and Warning Directives
  • C# ErrorProvider Control: Windows Forms
  • C# event Examples
  • C# Get Every Nth Element From List (Modulo)
  • C# Excel Interop Example
  • C# Except (Remove Elements From Collection)
  • C# Extension Method
  • C# extern alias Example
  • C# Convert Feet, Inches
  • C# File.Delete
  • C# File Equals: Compare Files
  • C# File.Exists Method
  • C# try Keyword
  • C# TryGetValue (Get Value From Dictionary)
  • C# Tuple Examples
  • C# Type Class: Returned by typeof, GetType
  • C# TypeInitializationException
  • C# Union: Combine and Remove Duplicate Elements
  • C# Unreachable Code Detected
  • C# Unsafe Keyword: Fixed, Pointers
  • C# Uppercase First Letter
  • C# Uri and UriBuilder Classes
  • C# Using Alias Example
  • C# using Statement: Dispose and IDisposable
  • C# value Keyword
  • C# ValueTuple Examples (System.ValueTuple, ToTuple)
  • C# ValueType Examples
  • C# Variable Initializer for Class Field
  • C# Word Count
  • C# Word Interop: Microsoft.Office.Interop.Word
  • C# XElement Example (XElement.Load, XName)
  • C# Zip Method (Use Lambda on Two Collections)
  • C# File.Move Method, Rename File
  • C# File.Open Examples
  • C# File.ReadAllBytes, Get Byte Array From File
  • C# File.ReadAllLines, Get String Array From File
  • C# File.ReadAllText, Get String From File
  • C# File.ReadLines, Use foreach Over Strings
  • C# File.Replace Method
  • C# FileInfo Length, Get File Size
  • C# FileInfo Examples
  • C# File Handling
  • C# Filename With Date Example (DateTime.Now)
  • C# FileNotFoundException (catch Example)
  • C# FileStream Length, Get Byte Count From File
  • C# FileStream Example, File.Create
  • C# FileSystemWatcher Tutorial (Changed, e.Name)
  • C# finally Keyword
  • C# First Sentence
  • C# FirstOrDefault (Get First Element If It Exists)
  • C# Fisher Yates Shuffle: Generic Method
  • C# fixed Keyword (unsafe)
  • C# Flatten Array (Convert 2D to 1D)
  • C# First Words in String
  • C# First (Get Matching Element With Lambda)
  • C# ContainsKey Method (Key Exists in Dictionary)
  • C# Convert ArrayList to Array (Use ToArray)
  • C# Convert ArrayList to List
  • C# Convert Bool to Int
  • C# Convert Bytes to Megabytes
  • C# Convert Degrees Celsius to Fahrenheit
  • C# Convert Dictionary to List
  • C# Convert Dictionary to String (Write to File)
  • C# Convert List to Array
  • C# Convert List to DataTable (DataGridView)
  • C# Convert List to String
  • C# Convert Miles to Kilometers
  • C# Convert Milliseconds, Seconds, Minutes
  • C# Convert Nanoseconds, Microseconds, Milliseconds
  • C# Convert String Array to String
  • C# Convert TimeSpan to Long
  • C# Convert Types
  • C# Copy Dictionary
  • C# Count Elements in Array and List
  • C# FromOADate and Excel Dates
  • C# Generic Class, Generic Method Examples
  • C# GetEnumerator: While MoveNext, Get Current
  • C# GetHashCode (String Method)
  • C# Thumbnail Image With GetThumbnailImage
  • C# GetType Method
  • C# Global Variable Examples (Public Static Property)
  • ASP.NET Global Variables Example
  • C# Group By Operator: LINQ
  • GroupBox: Windows Forms
  • C# GroupBy Method: LINQ
  • C# GroupJoin Method
  • C# GZipStream Example (DeflateStream)
  • C# HashSet Examples
  • C# Hashtable Examples
  • HelpProvider Control Use
  • C# HTML and XML Handling
  • C# HtmlEncode and HtmlDecode
  • C# HtmlTextWriter Example
  • C# HttpUtility.HtmlEncode Methods
  • C# HybridDictionary
  • C# default Operator
  • C# DefaultIfEmpty Method
  • C# Define and Undef Directives
  • C# Destructor
  • C# DialogResult: Windows Forms
  • C# Dictionary, Read and Write Binary File
  • C# Dictionary Memory
  • C# Dictionary Optimization, Increase Capacity
  • C# Dictionary Optimization, Test With ContainsKey
  • C# DictionaryEntry Example (Hashtable)
  • C# Directives
  • C# Directory.CreateDirectory, Create New Folder
  • C# Directory.GetFiles Example (Get List of Files)
  • C# DivideByZeroException
  • C# DllImport Attribute
  • C# Do While Loop Example
  • C# DriveInfo Examples
  • C# DropDownItems Control
  • C# IComparable Example, CompareTo: Sort Objects
  • C# IDictionary Generic Interface
  • C# IEnumerable Examples
  • C# IList Generic Interface: List and Array
  • C# Image Type
  • C# ImageList Use: Windows Forms
  • C# Increment String That Contains a Number
  • C# Increment, Preincrement and Decrement Ints
  • Dot Net Perls
  • C# Indexer Examples (This Keyword, get and set)
  • C# IndexOutOfRangeException
  • C# Inheritance
  • C# Insert String Examples
  • C# int Array
  • C# Interface Examples
  • C# Interlocked Examples: Add, CompareExchange
  • C# Intersect: Get Common Elements
  • C# InvalidCastException
  • C# InvalidOperationException: Collection Was Modified
  • C# IOException Type: File, Directory Not Found
  • C# IOrderedEnumerable (Query Expression With orderby)
  • C# is: Cast Examples
  • C# IsFixedSize, IsReadOnly and IsSynchronized Arrays
  • C# string.IsNullOrEmpty, IsNullOrWhiteSpace
  • C# IsSorted Method: If Array Is Already Sorted
  • C# Jagged Array Examples
  • C# join Examples (LINQ)
  • C# KeyCode Property and KeyDown
  • C# KeyNotFoundException: Key Not Present in Dictionary
  • C# KeyValuePair Examples
  • C# Line Count for File
  • C# Line Directive
  • C# LinkedList
  • C# List CopyTo (Copy List Elements to Array)
  • C# List Equals (If Elements Are the Same)
  • C# List Find and Exists Examples
  • C# List Insert Performance
  • ASP.NET LiteralControl Example
  • C# Locality Optimizations (Memory Hierarchy)
  • C# lock Keyword
  • C# Long and ulong Types
  • C# Loop Over String Chars: Foreach, For
  • C# Loop Over String Array
  • C# Main args Examples
  • C# Map Example
  • ASP.NET MapPath: Virtual and Physical Paths
  • C# Mask Optimization
  • C# MaskedTextBox Example
  • C# Math.Abs: Absolute Value
  • C# Math.Ceiling Usage
  • C# Math.Floor Method
  • C# Math.Max and Math.Min Examples
  • C# Math.Pow Method, Exponents
  • C# Math.Round Examples: MidpointRounding
  • C# Math Type
  • C# Max and Min: Get Highest or Lowest Element
  • C# MemoryFailPoint and InsufficientMemoryException
  • C# MemoryStream: Use Stream on Byte Array
  • C# MenuStrip: Windows Forms
  • C# Modulo Operator: Get Remainder From Division
  • C# MonthCalendar Control: Windows Forms
  • C# Multiple Return Values
  • C# Multiply Numbers
  • C# namespace Keyword
  • C# NameValueCollection Usage
  • C# Nested Lists: Create 2D List or Jagged List
  • C# Nested Switch Statement
  • C# Environment.NewLine
  • C# Normalize, IsNormalized Methods
  • C# Null String Example
  • C# null Keyword
  • C# Nullable Examples
  • C# NullReferenceException and Null Parameter
  • C# Object Array
  • C# Obsolete Attribute
  • C# OfType Examples
  • C# OpenFileDialog Example
  • C# operator Keyword
  • C# Odd and Even Numbers
  • C# Bitwise Or
  • C# orderby Query Keyword
  • C# out Parameter
  • C# OutOfMemoryException
  • C# OverflowException
  • C# Overload Method
  • C# Override Method
  • C# PadRight and PadLeft: String Columns
  • C# Get Paragraph From HTML With Regex
  • C# Parallel.For Example (Benchmark)
  • C# Parallel.Invoke: Run Methods on Separate Threads
  • C# Parameter Optimization
  • C# Parameter Passing, ref and out
  • C# params Keyword
  • C# int.Parse: Convert Strings to Integers
  • C# partial Keyword
  • C# Path.ChangeExtension
  • C# Path Exists Example
  • C# Path.GetExtension: File Extension
  • C# Path.GetRandomFileName Method
  • C# Pragma Directive
  • C# Predicate (Lambda That Returns True or False)
  • C# Pretty Date Format (Hours or Minutes Ago)
  • C# PreviewKeyDown Event
  • C# Random Lowercase Letter
  • C# Random Paragraphs and Sentences
  • C# Random String
  • C# Random Number Examples
  • C# StreamReader ReadLine, ReadLineAsync Examples
  • C# readonly Keyword
  • C# Recursion Example
  • C# Regex, Read and Match File Lines
  • C# Regex Groups, Named Group Example
  • C# Regex.Matches Quote Example
  • C# Regex.Matches Method: foreach Match, Capture
  • C# Regex.Replace, Matching End of String
  • C# Regex.Replace, Remove Numbers From String
  • C# Regex.Replace, Merge Multiple Spaces
  • C# Regex.Replace Examples: MatchEvaluator
  • C# Regex.Split, Get Numbers From String
  • C# Regex.Split Examples
  • C# Regex Trim, Remove Start and End Spaces
  • C# RegexOptions.Compiled
  • C# RegexOptions.IgnoreCase Example
  • C# RegexOptions.Multiline
  • C# Region and endregion
  • C# Remove Char From String at Index
  • C# Remove Element
  • C# Remove HTML Tags
  • C# Remove String
  • C# Reserved Filenames
  • C# return Keyword
  • C# Reverse String
  • C# Reverse Words
  • C# Reverse Extension Method
  • C# RichTextBox Example
  • C# Right String Part
  • C# RNGCryptoServiceProvider Example
  • C# ROT13 Method, Char Lookup Table
  • C# SelectMany Example: LINQ
  • C# Sentinel Optimization
  • C# SequenceEqual Method (If Two Arrays Are Equal)
  • C# Shift Operators (Bitwise)
  • C# Short and ushort Types
  • C# Single Method: Get Element If Only One Matches
  • C# SingleOrDefault
  • C# Singleton Pattern Versus Static Class
  • C# Singleton Class
  • C# sizeof Keyword
  • C# Skip and SkipWhile Examples
  • C# Sleep Method (Pause)
  • C# Sort Dictionary: Keys and Values
  • C# Sort by File Size
  • C# Sort, Ignore Leading Chars
  • C# Sort KeyValuePair List: CompareTo
  • C# Sort Strings by Length
  • C# Thread.SpinWait Example
  • C# Math.Sqrt Method
  • C# stackalloc Operator
  • C# StackOverflowException
  • C# StartsWith and EndsWith String Methods
  • C# Static Array
  • C# Static Dictionary
  • C# Stopwatch Examples
  • C# Stream
  • C# StreamReader ReadToEnd Example (Read Entire File)
  • C# StreamReader ReadToEndAsync Example (Performance)
  • C# StreamReader Examples
  • C# StreamWriter Examples
  • C# String Append (Add Strings)
  • C# String Compare and CompareTo Methods
  • C# String Constructor (new string)
  • C# string.Copy Method
  • C# CopyTo String Method: Put Chars in Array
  • C# Empty String Examples
  • C# String Equals Examples
  • C# String For Loop, Count Spaces in String
  • C# string.Intern and IsInterned
  • C# String IsUpper, IsLower
  • C# String Length Property: Get Character Count
  • C# String Literal: Newline and Quote Examples
  • C# StringBuilder Capacity
  • C# StringBuilder Clear (Set Length to Zero)
  • C# StringBuilder Data Types
  • C# StringBuilder Performance
  • C# StringBuilder Equals (If Chars Are Equal)
  • C# StringBuilder Memory
  • C# StringBuilder ToString: Get String From StringBuilder
  • C# StringWriter Class
  • C# Sum Method: Add up All Numbers
  • C# Switch Char, Test Chars With Cases
  • C# Switch Enum
  • C# System (using System namespace)
  • C# Tag Property: Windows Forms
  • C# TextInfo Examples
  • C# TextReader, Returned by File.OpenText
  • C# TextWriter, Returned by File.CreateText
  • C# this Keyword
  • C# ThreadPool
  • C# Thread Join Method (Join Array of Threads)
  • C# ThreadPool.SetMinThreads Method
  • C# TimeZone Examples
  • C# Get Title From HTML With Regex
  • C# ToArray Extension Method
  • C# ToCharArray: Convert String to Array
  • C# ToDictionary Method
  • C# Token
  • C# ToList Extension Method
  • C# ToLookup Method (Get ILookup)
  • C# ToLower and ToUpper: Uppercase and Lowercase Strings
  • ToolStripContainer Control: Dock, Properties
  • C# ToolTip: Windows Forms
  • C# ToString Integer Optimization
  • C# ToString: Get String From Object
  • C# ToTitleCase Method
  • C# TrackBar: Windows Forms
  • C# Tree and Nodes Example: Directed Acyclic Word Graph
  • C# TreeView Tutorial
  • C# Trim Strings
  • C# Thread Methods
  • C# History
  • C# Features
  • C# Variables
  • C# Data Types
  • C# Operators
  • C# Keywords
  • C# New Features | C# Version Features
  • C# Programs
  • C# Program to swap numbers without third variable
  • C# Program to convert Decimal to Binary
  • C# Program to Convert Number in Characters
  • C# Program to Print Alphabet Triangle
  • C# Program to print Number Triangle
  • C# Program to generate Fibonacci Triangle
  • C# String Compare() method
  • C# String CompareOrdinal() method
  • C# String CompareTo() method
  • C# String Concat() method
  • C# String Contains() method
  • C# String CopyTo() method
  • C# String EndsWith() method
  • C# String Equals() method
  • C# String Format() method
  • C# String IndexOf() method
  • C# String Insert() method
  • C# String Intern(String str) method
  • C# String IsInterned() method
  • C# String Normalize() method
  • C# String IsNullOrEmpty() method
  • C# String IsNullOrWhiteSpace() method
  • C# String Join() method
  • C# String LastIndexOf() method
  • C# String LastIndexOfAny() method
  • C# String PadLeft() method
  • C# String PadRight() method
  • C# Nullable
  • C# String Remove() method
  • C# String Replace() method
  • C# String Split() method
  • C# String StartsWith() method
  • C# String SubString() method
  • C# Partial Types
  • C# Iterators
  • C# Delegate Covariance
  • C# Delegate Inference
  • C# Anonymous Types
  • C# Extension Methods
  • C# Query Expression
  • C# Partial Method
  • C# Implicitly Typed Local Variable
  • C# Object and Collection Initializer
  • C# Auto Implemented Properties
  • C# Dynamic Binding
  • C# Named and Optional Arguments
  • C# Asynchronous Methods
  • C# Caller Info Attributes
  • C# Using Static Directive
  • C# Exception Filters
  • C# Await in Catch Finally Blocks
  • C# Default Values for Getter Only Properties
  • C# Expression Bodied Members
  • C# Null Propagator
  • C# String Interpolation
  • C# nameof operator
  • C# Dictionary Initializer
  • C# Pattern Matching
  • C# Tuples
  • C# Deconstruction
  • C# Local Functions
  • C# Binary Literals
  • C# Ref Returns and Locals
  • C# Expression Bodied Constructors and Finalizers
  • C# Expression Bodied Getters and Setters
  • C# Async Main
  • C# Default Expression

Related Links

Adjectives
Ado
Ai
Android
Angular
Antonyms
Apache
Articles
Asp
Autocad
Automata
Aws
Azure
Basic
Binary
Bitcoin
Blockchain
C
Cassandra
Change
Coa
Computer
Control
Cpp
Create
Creating
C-Sharp
Cyber
Daa
Data
Dbms
Deletion
Devops
Difference
Discrete
Es6
Ethical
Examples
Features
Firebase
Flutter
Fs
Git
Go
Hbase
History
Hive
Hiveql
How
Html
Idioms
Insertion
Installing
Ios
Java
Joomla
Js
Kafka
Kali
Laravel
Logical
Machine
Matlab
Matrix
Mongodb
Mysql
One
Opencv
Oracle
Ordering
Os
Pandas
Php
Pig
Pl
Postgresql
Powershell
Prepositions
Program
Python
React
Ruby
Scala
Selecting
Selenium
Sentence
Seo
Sharepoint
Software
Spellings
Spotting
Spring
Sql
Sqlite
Sqoop
Svn
Swift
Synonyms
Talend
Testng
Types
Uml
Unity
Vbnet
Verbal
Webdriver
What
Wpf

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Индекс производительности windows 7 hdd
  • Check point capsule workspace windows
  • Spotify на windows phone 10
  • Где хранятся корневые сертификаты в windows 7
  • Нужно ли очищать папку temp в windows 10