Instructables

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

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 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)
{

}
lemonie5 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

sch7 lemonie4 months ago

good

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


HELP ME!
Cavy5 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)  Cavy5 years ago
Yes you are right. I'll do it in this week I think so :)
Cavy lucash5 years ago
kindly pm me if your done with the additional modifications. thanks!
Cavy5 years ago
you can now change the apps name from "simple phonebook" to "simple phonebook: with search and edit". that would better eh!?