How to create simple phone book application C#

Picture of How to create simple phone book application C#
Hi, I am Luke, it's my first Instructable. I want to show you how to create a simple phone book application in Microsoft Visual Studio using C#. It's good to have some basic knowledge of programming before making this project.

Let's get started.
We need Microsoft Visual Studio, it's free for students, you can get Professional Edition from MSDNAA. Search google for more information.

This is how our application will look like:

Remove these adsRemove these ads by Signing Up

Step 1: Creating new project in Microsoft Visual Studio

Picture of Creating new project in Microsoft Visual Studio
Start Microsoft Visual Studio, and create new Project, choose Windows Forms Application remeber project type is Visual C#. You can name your project whatever you want and change location for the project if nessesary.

Step 2: Adding everything to Form

Picture of Adding everything to Form
Now, it's a empty Form. Let's add to it some components from toolbox as seen on the picture. They are: DataGridView, SaveFileDioalog, OpenFileDialog and menuStrip

Step 3: Adding Columns

Picture of Adding Columns
After adding DataGridView, We have empty space, click right mouse button on it and select edit Columns.

Step 4: Before writing a code

Picture of Before writing a code
Make sure your form looks like this and DataGridView is named "GRID". You can set it in properies window

Step 5: Writing a code

Click two times on each element of your menu, to create events, each time a window with a code will be showed, so go back and to it with all (Save, Open, Close)
That what we need in code :

private void SaveToolStripMenuItem_Click(object sender, EventArgs e)


private void OpenToolStripMenuItem_Click(object sender, EventArgs e)


private void CloseToolStripMenuItem_Click(object sender, EventArgs e)

ZakirH24 months ago

sign up and earn money

lemonie6 years ago
Hi Man, welcome to Instructables. This is something I wouldn't do, but it's well done (and the English is fine). L

Keep getting this error (GRID) not found in context, can anyone help

change your datagridview1 name with GRID
sch7 lemonie1 year ago


When i click in save button on menustrip the dialog window opens and where I must save the file? Can anybody help me?

JarosławM10 months ago

A czy to samo, tylko po Polsku, jest gdzieś dostępne?

rrustemi4 years ago
Error 2 'Phonebook.Form1.Dispose(bool)': no suitable method found to override

Cavy6 years ago
hi luke!
i guess this would be more useful if it has search, edit buttons and textbox or label to display the search item.._
coz it would be easier to search for the person your looking for if you listed 50 or more names.

hope you add em. ,
lucash (author)  Cavy6 years ago
Yes you are right. I'll do it in this week I think so :)
Cavy lucash6 years ago
kindly pm me if your done with the additional modifications. thanks!
Cavy6 years ago
you can now change the apps name from "simple phonebook" to "simple phonebook: with search and edit". that would better eh!?