Blog Archives

Visual Studio: Display A File List In A DataGridView Control

This example also shows how to extract an icon image from a file in a windows directory and display the icon in a DataGridView Control.  One advantage of displaying a list of files in the DataGridView Control, is that you

Tagged with: , , , , , , ,
Posted in Visual Studio Code Examples

Visual Studio String Functions-CSharp

string sHold = “”; int nIndex = 0; //Replaces a string with a specified string. sHold = “String Test”; sHold = sHold.Replace(“String”, “Replace”); //Returns “Replace Test” //Removes a specified number of characters from a string //The first number is the

Tagged with: , , , , ,
Posted in Visual Studio Code Examples

Display A Directory List In A TextBox Control

Display A Directory List In A TextBox Control First complete the following steps: Create a new C# Windows Application in Visual Studio. Add a button control to the form. Add a TextBox Control to the form. Change the Multiline Property

Tagged with: , , , , , ,
Posted in Visual Studio Code Examples

Create a HTML File From a DataGridView Control

First complete the following steps: Create a new C# Windows Application in Visual Studio. Add two button controls to the form. Add a DataGridView Control to the form. Double Click on the Form and add the code below to the

Tagged with: , , , , , ,
Posted in Visual Studio Code Examples

Export To A Text File From A DataGridView Control

Save Data From A DataGridView Control To A Text File Steps: Create a new C# project. Add a button control to Form1. Add a DataGridView Control to Form1. Double click on the form, and copy and the code below into

Tagged with: , , , , , ,
Posted in Visual Studio Code Examples

Dynamically Create and Execute a Batch File Using Visual Studio

Create a directory called “c:\bat”. Create a directory called “c:\zip”. Copy some .zip files to “c:\zip” Create a new Visual Studio C# application. Add a button to Form1. Double click on button1 and copy and paste the code below into

Tagged with: , , , , ,
Posted in Visual Studio Code Examples

Display A Text File In A DataGridView

Create a text file on your hard drive, copy and paste this code into the text file, and save your changes. FIELD1;FIELD2;FIELD3;FIELD4 1;2;3;4 5;6;7;8 9;10;11;12 13;14;15;16 Complete the following steps: Create a new Visual Studio C# Application. Add a DataGridView

Tagged with: , , , , ,
Posted in Visual Studio Code Examples

Visual Studio Write to a Text File

Visual Studio C# Write to a File: In order to test this code, do the following: Create a new Windows Application Add a New form Add a textbox to the form; use the default name for the textbox. Make sure to

Tagged with: , , , , ,
Posted in Visual Studio Code Examples

Visual Studio OpenFileDialog Filter

OpenFileDialog.Filter In order to add multiple filters in the same selection, use the semicolon (;): openFileDiag1 = “Text Files (*.txt);CSV (*.csv);zip files (*.zip)|*.txt;*.csv;*.zip|All files (*.*)|*.*”; You place the display name to the left of the pipe symbol (|), and to

Tagged with: ,
Posted in Visual Studio Code Examples

Visual Studio – Add Double Quotes To Text

C# string sText = “This expample shows how to add double quotes to text.”; sText = “\”” + sText + “\””; Visual Basic Dim sText As String = “This expample shows how to add double quotes to text.” sText =

Tagged with: , , ,
Posted in Visual Studio Code Examples