WinformBasics - Creating The Project

  • From: "RicksPlace" <ofbgmail@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 26 May 2010 08:03:56 -0400

Hi Guys: I am deviating from the original plan and going to do a few tutorials 
on basic skills for the absolute nubes out there. After we walk through using 
the IDE and some basics, I will expand the project to include the Menu Bar and 
more advanced controls like TreeViews and other goodies as we talked about. For 
now please walk these articles and let me know if you find any errors or if 
something is done diferently in JAWS.
I will just touch on some of the basics so beginners can see what all that 
stuff is in the IDE and how to do simple math and use a simple string with a 
Button and TextBox.
After that we can dig into adding a Menu Bar and go from there since the 
process of adding a MenuBar is the same as adding any other control like a 
Button and a TextBox.
There are several folks who need a Raw Beginners approach so I am going to  do 
it down and dirty but keep it simple to understand with only a few simple 
examples to help them get the feel for what a form is, a button, TextBox and 
how to use a Button's Click Event to do something. A few math operations and 
string operations should make the next module doable for them as well.
Sorry for the delay.
Rick USA
C01 How To Create A New Winforms Project
Index:
Section01: Introduction
Section02: Definitions
    OOP Definition:
   TreeView Definition:

Section03: Create The Project    
    Step01: The Start Page
   Step02: The New Project Dialog
    Step03: Modify Form1
    Step04: Test The Form
Section04: Save The Project
Section05: Deleting A Project
*****
Section01: Introduction
We now have our Integrated development environment ( IDE ) set up for 
accessibility. 
We will do 2 things in this tutorial:
1: Create a Winforms Project called CSharpWinformBasics.
2: Set any, and every, window in the IDE we can to be a Tabbed Document. 
3: Test our new project.
In any of the Visual Studio Modules like C# or Vb.net we as screen reader users 
want to set every possible window to be a Tabbed Document. This is because we 
can close Tabbed Documents easily by hitting the Ctrl+F4 HotKey 
combination.When we close a window it is removed from the work space. When we 
just hide a window it's active label is still on the work space. For some 
things if you mouse over them they will automatically open or expand without 
telling you. Hidden files can mess with a Screen Reader by overlapping windows 
we might be working in. So, we will usually want to be able to close windows 
instead of just hiding them. 
We can set a window to be a Tabbed Document under the Window Menu.
Whenever anything pops up on the screen for the first time we want to try and 
set it to be a Tabbed Document. Often windows, like the Error Window and 
others, are not even listed in the list of open Windows under the Window Menu 
but so long as the Tabbed Document item is not Disabled and not already checked 
you can set any window to be a Tabbed Document.
Note: You can also right mouse click the Tab Name of any dialog or window and, 
if it has the option in the PopUp, set it to be a Tabbed Document.
Lets see how this works.
Open CSharp by clicking your new DeskTop Icon.
The IDE opens in the Start Page. You can check it by reading the Title Bar ( 
Ctrl+Shift+T  in Windoweyes ).
We will go through this page, window, in a few minutes.
Hit the Alt key to bring up the IDEs main Menu Bar.
Cursor to the Window menu and cursor down through the options.
I hear:
New Window Disabled
Split Disabled
Floating
Dockable
Tabbed Document Checked
Auto Hide Disabled
Hide
New Horizontal Tabbed Group
New Vertical Tabbed Group
Close All Documents
Reset Window Layout
one Start Page Checked
two Solution Explorer 
Windows...
You can see that in the list of open windows that the Start Page is the active 
window because it is checked.
The Solution Explorer window is open but is not the active window because it is 
not checked.
Note that you can click any open windows to be taken to that window with focus 
set to that window.
Cursor and, if the item labeled "Tabbed Document" in your list is not checked 
then check it, in Windoweyes just hit enter on it ).
This will set the Active Window to be a Tabbed Document.
You can go back under the Window Menu and cursor up or down to Tabbed Document 
and, if not Disabled and if not checked, hcheck it. If there is an active 
window, likely Solution Explorer in my case, it will be set to be a Tabbed 
Document. In fact if there is anything on your screen try going into the Window 
menu and, even if there are no windows listed, check the Tabbed Document item 
if it is not disabled. There are windows, dialogs or other objects that can be 
set to tabbed documents that might not appear in the list of open windows from 
time to time and we want everything possible set to be a Tabbed Document if we 
use a Screen Reader.
Note: you can also right mouse click the name of any window, the Tab Label in 
the File Tab Channel, and if a Context Pop Up comes up, and if it has the 
"Tabbed Document" option you can click it as well.
If necessary uncheck the "Docked" or "Float" Window type to be able to check 
the "Tabbed Document" checkbox.
Now, you should be able to close any open windows by hitting Ctrl+F4 or by 
hitting the Close All Documents under the Window Menu.

So, close everything that is open.
When the work area is clean and I listen to the Tital Bar ( Ctrl+Shift+T in 
WindowEyes ) I hear:
Normal Microsoft Visual C#  2008 Express Edition Normal
That tells me all windows are closed and the relatively clean Work Space is 
ready to be used.
You can hit Alt+F4 to close the IDE, (CSharp.net). Answer No if you get a PopUp 
asking if you want to save your work.

In this tutorial we will not dig into detail about the windows we will use.
We will do that in the next tutorial or 2.
Right now we just want to create a CSharp Project that actually does something 
after grinding out all those IDE Settings we had to go through - ugh!

Section02: Definitions
OOP Definition:
OOP Object Orientated Programming. 
Just means you code in a modular fashion using blocks of code and things like 
buttons, text boxes, WebPages and other things. If a programming construct has 
a name it might be considered an object. The name of something is considered 
one of it's properties. Usually I don't think of math or logical operators or 
language KeyWords as objects but keep the definition to those things we either 
use to create or structure our code. don't get hung up on OOP, it is just a 
conceptual thing and we will be working with simple, tangible objects in these 
tutorials. 
If something we create or work with ( Not the IDE Features or Language Features 
) has a name, We might think of it as an object for now.

Our CSharpWinformBasics Project is an object. It has a name and is used to hold 
code and other objects like Forms, Subroutines, folders and all that jazz.
TreeView Definition:
I mention this early because we will use a TreeView to navigate  the files and 
folders listed in the IDE in a Window called "Solution Explorer". If, and when, 
we add a User TreeView to our project I will dig into them in more detail. I 
just mention it now because the tutorial references opening and closing 
branches and this article is starting to explain objects used in creating 
programs.
A TreeView can be thought of as like a Folder with sub folders. You can open or 
close folders, we call them Branches, by right or left cursoring on the Branch 
name. If there are no more levels under a branch it is called the Leaf and a 
leaf can be clicked by a user to do something like a button might be clicked.
A TreeView is considered an Object - it has a name property.

 Section03: Create The Project
Step01: The Start Page
Open your IDE by clicking on your new DeskTop Icon.
You should be on the Start Page.
You will likely be in the Project ListView . 
This is where all your projects you are working on or have created earlier will 
be listed. 
Clicking one of them opens that project so you can work on it. 
Tabbing around you might hear Project ... and again Project ... I hear this 
twice with Windoweyes. 
These are buttons that bring up dialogs. The first one is the Open Project 
dialog, the second  is a Create New Project dialog. I never use them - just a 
preference.
Tabbing there are 3 List Controls with news and some links of general interest. 
Again, I never use them. 
Tab and I am returned to the List of my Existing Projects.
Lets clean our Work Area before continuing.
If you set the Start Page to a "Tabbed Document" just hit ctrl+F4 to close it.
Otherwise, hit Alt+w then "L" to close all open windows.

Step02: New Project Dialog
Hit Alt to open the IDEs Main Menu Bar:
Under the File Menu click New Project.
(The New Project Dialog Is Opened).
You can check it by reading the Title Bar if you want.
Tabbing around this dialog I hear:
NewProject Templates ListView, This was the control in focus when the Dialog 
Opened.
Name This is a TextBox where you will type the Projects name.  It has a default 
depending on which Project type was highlighted in the ProjectTemplates 
ListView.
Then the OK and Cancel Buttons followed by a LargeIcons Button and back to the 
ProjectTemplates ListView.
So, place focus in the ProjectTemplates Listview and cursor over the Windows 
Forms Application item, to highlight it, but do not hit enter or any action key 
yet.
Tab to the Name Box and change it to CSharpWinformBasics then tab and click OK.
In about 30 seconds you will find yourself in the Forms Designer.
You can tell by reading the Title Bar.
Mine reads:
Normal CSharpWinformBasics - Microsoft  Visual C#  2008  Express Edition Normal.
This is the Forms Designer and by default the Default Form called Form1 is 
being displayed graphically.
Just hit Ctrl+F4 to close this window for now.
Hit Ctrl+Alt+L or click Solution Explorer under the View Menu to open the 
Solution Explorer Window.
Again, if this is not already set to a Tabbed Document go under the Window Menu 
and set it to Tabbed Document.
The Solution Explorer is the main place where you will see all the Folders and 
files that make up your project.
When I cursor through it I hear:
CSharpWinformBasics Expanded
Properties closed
References closed
Form1.cs closed
As you can tell this is a sort of TreeView of folders.
This is the basic project structure you will use to navigate your project's 
objects.
Step02: Modify Form1
We will do allot of our work in the Forms Designer so:
Hit ( Ctrl+Alt+L ) to bring up Solution Explorer.
Cursor to Form1.cs and hit enter on it.
( The Forms Designer opens with Form1 loaded in it )
Note: A form is the equivalent to a WebPage but for a Windows application 
conceptually.
We put things like buttons and text Boxes on it and display it to the user.

Now, Hit Ctrl-Alt-X to open the ToolBox where all UI and other Winforms 
controls can be selected.
Note: You can also Open the ToolBox under the View Menu.
Go to the TopOfPage ( Ctrl+TopOfPage in WindowEyes).
If not expanded expand the AllWindowsForms Branch.
Cursor down to the item named Button and hit enter on it.
( A Button named Button1 by default is dropped on the form. )
Hit F4 to open the Properties Window with Button1 Selected as the Active 
Control.
Note: Form1 and button1 are both considered Objects in the OOP conceptual model 
of thinking about programming.
Cursor up or down, if necessary, to the Property Labeled Text which has it's 
default value set to Button1, Tab to get into the EditBox, change the text to 
something like Say Hello, Back Tab to return to the properties list and that 
property is now set.
Back Tab to the Tool Bar and right cursor to the Events Button and hit enter on 
it.
Cursor up or down, if necessary, to the Click Event and hit enter on it.
You are placed in the CSharp Code Editor Window inside the Subroutine that will 
get executed whenever Button1 is clicked.
Note: We will do some explanation of this code in the next tutorial.
It looks like:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

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

  private void button1_Click(object sender, EventArgs e)
  {

  }
 }
}
Cursor down to the blank line between the opening and closing braces ( Left 
brace and right brace under the   private void button1_Click(object sender, 
EventArgs e) Opening Subroutine Tag.
Type:
MessageBox.Show( "Hello World" );
// End Of Button1 click Event sub
The Subroutine should now look like:
  private void button1_Click(object sender, EventArgs e)
  {
MessageBox.Show( "Hello World");
// End Of Button1 click Event sub
  }
Notice how the contents of this subroutine are enclosed in the opening and 
closing braces. All code blocks of any type are enclosed in opening and closing 
braces in the CSharp language.
The MessageBox.Show( "xxx" ) is an example of using an object and a method.
You see the word MessageBox, that is the object and internally defined in the 
Windows Framework as a class. it is followed by a period and by the word Show. 
the word Show is a method, like a Subroutine, defined inside the MessageBox 
Class. 
Anything between the left and right parenthsis are considered parameters and 
passed to the Subroutine named Show.
We will dig into this much more later when we create our own class with a 
subroutine method. 
The // just says anything on this line is just a comment so don't try and run 
it to the compiler.
Hit Ctrl+F4 to close the Editor.

If any other windows are open close them as well by hitting Ctrl+F4 after 
making sure they are set to Tabbed Documents under the Windo Menu.
Step04: Test The Form
Hit F5 to run your project.
If you have no errors you can click the Say Hello button on the form that is 
displayed.
You will hear the MessageBox Dialog pop up with the words Hello World. There is 
an OK button on a Message box so tab to it and click it to close the MessageBox 
Dialog.
Then hit Alt+F4 to close the Test Run.
On the other hand, If you have any errors, the Error List Window should pop up, 
or you can bring it up from under the View Menu. 
You can Left Mouse DOUBLE click on the error message in the error List window 
which is a ListBox of sorts and be taken to the line in the Text Editor where 
the error occurs. 
Note: don't forget to set the Error Window to a Tabbed Document.
Then run the project as described above.

Section04: Save The Project
Hit Alt+F4 to close the project.
The IDE sees you have not saved it yet so a popup asks you if you want to save 
it, click Save.
The Save Project Dialog window comes up.
We will enter a name and a Location to save the project and specify a Solution 
Directory be created.
The name CSharpwinformBasics is already in the Name EditBox so tab to the 
location ComboBox.
cursor down in the ComboBox to the default project location:
c:\Documents And Settings\...\My Documents\ Documents\Visual Studio 
2008\Projects to highlight it.
Tab and check Create Directory For Solution. 
tab and click the Save Button.
The IDE is closed and the CSharpWinformBasics Project has been created.

You have just created your first SC# Project that has one form, Form1 which has 
One Button on it. 
Whenever the project is run and that button clicked the message Hello World 
will be displayed in a MessageBox Dialog.

Section05: Deleting A Project
Note: If you do this step remember to go back through this tutorial to ReCreate 
the project since we will use it in the next tutorial!

You can not delete a project directly from within the iDE.
To delete a project you go to the folder where it resides, delete the Project 
Folder and then go back into the IDE and try to open the project by clicking it 
in the ListView on the Start Page.
A PopUp Window will ask you if you want to remove the Directory Entry for the 
Project, click yes and the project entry is also removed from the IDE.
That is how you delete projects in Visual Studio.
If you want to try it out go under My Documents under the Visual Studio 2008 
folder. Under the Projects folder you should find your program. Delete that 
folder. Then Open CSharp and you should see CSharpWinformBasics still in the 
Projects ListView. Click it and you should be asked if you want to remove it 
from the Projects ListView. Answer yes and you are done.
Remember! If you delete it you will have to ReCreate it to continue with the 
next tutorial.
In the next tutorial we will expand on our CSharpWinformBasics project to 
include more CSharp Code and a couple more User Interface Objects and start 
adding mor detail about object Properties we use.
Happy Programming!
Rick USA
EndOfArticle:

   YourName\  
 We wil
or
Under the View menu hit W or cursor down to the item labeled Properties Window 
and hit enter on it to open the Properties Window with the Button Selected.

Cursor down to the Item
V01 How To Create A New Winforms Project
Index:
Section01: Introduction
Section02: Definitions
    OOP Definition:
   TreeView Definition:

Section03: Create The Project    
    Step01: The Start Page
    Step02: The New Project Dialog
    Step03: Modify Form1
    Step04: Test The Form
Section04: Save The Project
Section05: Deleting A Project
*****
Section01: Introduction
We now have our Integrated development environment ( IDE ) initially set up for 
accessibility. 
We will do 2 things in this tutorial:
1: Create a Winforms Project called VBWinformBasics.
2: Set any, and every, window in the IDE we can to be a Tabbed Document. 
3: Test our new project.
In any of the Visual Studio Modules like C# or .net we as screen reader users 
want to set every possible window to be a Tabbed Document. This is because we 
can close Tabbed Documents easily by hitting the Ctrl+F4 HotKey 
combination.When we close a window it is removed from the work space. When we 
just hide a window it's active Tab Name is still on the work space. For some 
things if you mouse over them they will automatically open or expand without 
telling you. Hidden files can mess with a Screen Reader by overlapping windows 
we might be working in. So, we will usually want to be able to close windows 
instead of just hiding them. 
We set a window to be a Tabbed Document under the Window Menu.
Note: we can also do it using the mouse, right clicking the Tab Name and 
clicking "Tabbed Document" in the Context Menu PopUp if one comes up and has 
that choice.
Whenever anything pops up on the screen for the first time we want to try and 
set it to be a Tabbed Document. Often windows, like the Error Window and 
others, are not even listed in the list of open Windows under the Window Menu 
but so long as the Tabbed Document item is not Disabled and not already checked 
you can set any window to be a Tabbed Document.
Lets see how this works.
Open VB.net by clicking your new DeskTop Icon.
The IDE opens in the Start Page. You can check it by reading the Title Bar ( 
Ctrl+Shift+T  in Windoweyes ).
Hit the Alt key to bring up the IDEs main Menu Bar.
Cursor to the Window menu and cursor down through the options.
I hear:
New Window Disabled
Split Disabled
Floating
Dockable
Tabbed Document Checked
Auto Hide Disabled
Hide
New Horizontal Tabbed Group
New Vertical Tabbed Group
Close All Documents
Reset Window Layout
one Start Page Checked
two Solution Explorer 
Windows...
You can see that in the list of open windows that the Start Page is the active 
window because it is checked.
The Solution Explorer window is open but is not the active window because it is 
not checked.
If the item Tabbed Document in your list is not checked then check it, in 
Windoweyes just hit enter on it ).
This will set the Active Window to be a Tabbed Document.
Note: Again you can use the mouse to find the Window you want then right click 
it and set it to a Tabbed Document if that option is available in the PopUp.
You can go back under the Window Menu and cursor up or down to Tabbed Document 
and, if not Disabled and if not checked, hcheck it. If there is an active 
window, likely Solution Explorer in my case, it will be set to be a Tabbed 
Document. In fact if there is anything on your screen try going into the Window 
menu and, even if there are no windows listed, check the Tabbed Document item 
if it is not disabled. There are windows, dialogs or other objects that can be 
set to tabbed documents that might not appear in the list of open windows from 
time to time and we want everything possible set to be a Tabbed Document if we 
use a Screen Reader.
Now, you should be able to close any open windows by hitting Ctrl+F4 or by 
hitting the Close All Documents under the Window Menu.
Note: The Shortcut to close all open documents is Alt+w then "l".
So, close everything that is open.
When the work area is clean and I listen to the Tital Bar ( Ctrl+Shift+T in 
WindowEyes ) I hear:
Normal Microsoft Visual Basic 2008 Express Edition Normal
That tells me all windows are closed and the WorkSpace, actually a MDI Window, 
has focus.

In this tutorial we will not dig into detail about the windows we will use.
We will do that in the next tutorial or 2.
Right now we just want to create a VB.net Project that actually does something 
after grinding out all those IDE Settings we had to go through - ugh!

Section02: Definitions
OOP Definition:
OOP Object Orientated Programming. 
Just means you code in a modular fashion using blocks of code and things like 
buttons, text boxes, WebPages and other things. If a programming construct has 
a name it might be considered an object. The name of something is considered 
one of it's properties. Usually I don't think of math or logical operators or 
language KeyWords as objects but keep the definition to those things we either 
use to create or structure our code. don't get hung up on OOP, it is just a 
conceptual thing and we will be working with simple, tangible objects in these 
tutorials. 
If something we create or work with ( Not the IDE Features or Language Features 
) has a name, We might think of it as an object for now.

Our VBWinformBasics Project is an object. It has a name and is used to hold 
code and other objects like Forms, Subroutines, folders and all that jazz.
TreeView Definition:
I mention this early because we will use a TreeView to navigate our program. 
If, and when we add a User TreeView to our project I will dig into them in more 
detail. 
A TreeView is an object which can be thought of as like a Folder with sub 
folders. You can open or close folders, we call them Branches in a TreeView, by 
right or left cursoring on the Branch name. If there are no more levels under a 
branch it is called the Leaf and a leaf can be clicked by a user to do 
something like a button might be clicked.
A TreeView is considered an Object - it has a name property.

 Section03: Create The Project
Step01: The Start Page
Open your IDE by clicking on your new DeskTop Icon.
You should be on the Start Page.
You will likely be in the Project ListView . 
This is where all your projects you are working on or have created earlier will 
be listed. 
Clicking one of them opens that project so you can work on it. 
If you have not created any projects yet it will be empty.
Tabbing around you might hear Project ... and again Project ... I hear this 
twice with Windoweyes. These are buttons that bring up dialogs. The first one 
is the Open Project dialog, the second  is a Create New Project dialog. I never 
use them - just a preference.
Tabbing there are 3 List Controls with news and some links of general interest. 
Again, I never use them. 
Tab and I am returned to the List of my Existing Projects.
Lets clean our Work Area before continuing.
If you set the Start Page to a "Tabbed Document" just hit ctrl+F4 to close it.
Otherwise, hit Alt+w then "L" to close all open windows.

Step02: The New Project Dialog
Hit Alt to open the IDEs Main Menu Bar:
Under the File Menu click New Project.
(The New Project Dialog Is displayed) Check it by reading the Title Bar if you 
want.
Tabbing around this dialog I hear:
NewProject Templates ListView, This was the control in focus when the Dialog 
Opened.
Name This is a TextBox where you will type the Projects name.  It has a default 
depending on which Project type was highlighted in the ProjectTemplates 
ListView.
Then the OK and Cancel Buttons followed by a LargeIcons Button and back to the 
ProjectTemplates ListView.
So, place focus in the ProjectTemplates Listview by tabbing back to it and 
cursor over the Windows Forms Application item, to highlight it, but do not hit 
enter or any action key yet.
Tab to the Name Box and change it to VBWinformBasics then tab and click OK.
In about 30 seconds you will find yourself in the Forms Designer.
You can tell by reading the Title Bar.
Mine reads:
Normal VBWinformBasics - Microsoft  Visual Basic 2008  Express Edition Normal.
This is the Forms Designer and by default the Default Form called Form1 is 
being displayed graphically.
Just hit Ctrl+F4 to close this window for now.
Hit Ctrl+Alt+L or click Solution Explorer under the View Menu to open the 
Solution Explorer Window.
Again, if this is not already set to a Tabbed Document go under the Window Menu 
and set it to Tabbed Document.
The Solution Explorer is the main place where you will see all the Folders and 
files that make up your project.
When I cursor through it I hear:
VBWinformBasics Expanded
MyProject
Form1.vb closed
As you can tell this is a sort of TreeView of folders.
This is the basic project structure you will use to navigate your project's 
objects.
Note: conceptually A form is an object and equivalent to a WebPage but for a 
Windows application.
We put things like buttons and text Boxes on it and display it to the user.

Step03: Modify Form1
We will work in the Forms Designer so:
In Solution Explorer ( Ctrl+Alt+L )
Cursor to Form1.vb and hit enter on it.
( The Forms Designer opens with Form1 loaded in it )
This window might take a few seconds to load.
Hit Ctrl-Alt-X to open the ToolBox where all UI and other Winforms controls can 
be selected.
Note: You can also Open the ToolBox under the View Menu.
Go to the TopOfPage ( Ctrl+TopOfPage in WindowEyes).
If not expanded expand the AllWindowsForms Branch.
Cursor down to the item named Button and hit enter on it.
( A Button named Button1 by default is dropped on the form. )
Hit F4 to open the Properties Window with Button1 Selected as the Active 
Control.
Note: Form1 and button1 are both considered Objects in the OOP conceptual model 
of thinking about programming.
Note: We will walk around the Properties Window making some changes to a couple 
of UI ( Stands for User Interface )controls in the Next tutorial.
Cursor up or down, if necessary, to the Property Labeled Text which has it's 
default value set to Button1, Tab to get into the EditBox, change the text to 
something like Say Hello, Back Tab to return to the properties list and that 
property is now set.
Back Tab to the Tool Bar and right cursor to the Events Button and hit enter on 
it.
Cursor up or down, if necessary, to the Click Event and hit enter on it.
You are placed in the VB Code Editor Window inside the Subroutine that will get 
executed whenever Button1 is clicked.
Note: We will do some explanation of this code in the next tutorial.
It looks like:
Public Class Form1

Private Sub Button1_Click( ByVal sender As System.Object,  ByVal e As 
System.EventArgs) Handles Button1.Click

End Sub
End Class
Position your cursor on the blank line after the Subroutine opening tag and 
before the End Sub tag.
Type:
MessageBox.Show( "Hello World" )
Your code should look like:
Public Class Form1

Private Sub Button1_Click( ByVal sender As System.Object,  ByVal e As 
System.EventArgs) Handles Button1.Click
MessageBox.Show( "Hello World" )
End Sub
End Class
Note:  The word Public is called a Scope and Public means that this class can 
be used by any other modules in our project.
A class holds blocks of code inside Subroutines or functions as well as other 
things. It is terminated with the End Class Tag.
Here there is one Subroutine called Button1_Click

The Opening Tag is:
Private Sub Button1_Click( ByVal sender As System.Object,  ByVal e As 
System.EventArgs) Handles Button1.Click
The word Private is the scope and says that only other Subs and Functions 
defined (with an opening and closing tags)  that are defined inside this class 
can call this Subroutine.
So, while we might be able to use other features defined inside this class from 
other places in our project, this particular function, the click for the button 
we added to Form1, is private and can only be called by things defined in the 
Form1 class.This makes sense since the button is on the form and if the form is 
not being displayed you would not want to try and click it from anyplace else, 
it just would not be shown on the screen anyplace so MS assigned it a Scope of 
private. If any other module tried to call this Subroutine you would get a 
Runtime error. 
The Scope of something determines where you can use it. Here you can only use 
this button, it's click event, on Form1. 
The stuff inside the parenthsis are called parameters and are used to pass 
information into this subroutine. the ones here are system generated and they 
will hold information related to this form whenever a user clicks this button.
Now, Hit Ctrl+F4 to close the Editor.
If you are asked to save your work click yes.
If any other windows are open close them as well by hitting Ctrl+F4 after 
making sure they are set to Tabbed Documents.
Or, you can click "Close All Documents" under the Window menu.
Note: ShortCut Alt-w then "l".
Step04: Test The Project
Hit F5 to run your project.
If you have no errors you can click the Say Hello button on the form that is 
displayed.
You will hear the MessageBox Dialog pop up with the words Hello World. There is 
an OK button on a Message box so tab to it and click it to close the MessageBox 
Dialog.
Then hit Alt+F4 to close the Test Run.
On the other hand, If you have any errors, the Error List Window should pop up, 
or you can bring it up from under the View Menu if you have that feature turned 
off in the IDE Option settings. 
You can Left Mouse click on an error message in the error List window which is 
a ListBox of sorts and be taken to the line in the Text Editor where the error 
occurs. 
then fix it and checktthe Error List to make sure it says 0 errors, 0 warnings 
and 0 messages.
Note: don't forget to set the Error Window to a Tabbed Document.
Then run the project as described above.

Section04: Save The Project
Hit Alt+F4 to close the project.
The IDE sees you have not saved it yet so a popup asks you if you want to save 
it, click Save.
The Save Project Dialog window comes up.
We will enter a name and a Location to save the project and specify a Solution 
Directory be created.
The name VBwinformBasics is already in the Name EditBox so tab to the location 
ComboBox.
cursor down in the ComboBox to the default project location:
c:\Documents And Settings\...\My Documents\ Documents\Visual Studio 
2008\Projects to highlight it.
Tab and check Create Directory For Solution. 
tab and click the Save Button.
The IDE is closed and the VBWinformBasics Project has been created.

You have just created your first VB.net Project that has one form, Form1 which 
has One Button on it. 
Whenever the project is run and that button clicked the message Hello World 
will be displayed in a MessageBox Dialog.

Section05: Deleting A Project
Note: If you do this step remember to go back through this tutorial to ReCreate 
the project since we will use it in the next tutorial!

You can not delete a project directly from within the iDE.
To delete a project you go to the folder where it resides, delete the Project 
Folder and then go back into the IDE and try to open the project by clicking it 
in the ListView on the Start Page.
A PopUp Window will ask you if you want to remove the Directory Entry for the 
Project, click yes and the project entry is also removed from the IDE.
That is how you delete projects in Visual Studio.
If you want to try it:
In your My Documents Folder open the Visual Studio 2008 folder.
Open the Projects Folder and delete the VBWinformBasics folder.
Then close it up.
Open Vb.net, your desk top icon, and try and click on the VBWinformBasics 
project listed in the Projects ListView.
You will get a Pop Up telling you the fproject does not exist and asking you if 
you want to remove this entry from the Projects List.
Click Yes and you are done and the project is deleted.
I recommend walking this tutorial a couple times until you can create a project 
without reading the tutorial.
The process is just open Vb.net, click New Project under the File Menu giving 
it a name to create it. Then Hit Alt+F4, pick the location and check Create 
Solution Directory checkbox and ok.
Don't worry about messing with the form if you ReDo the project. You just want 
to become fast and versed in creating the project which is how every project 
begins. At that point it should take you 1 or 2 minutes to create a new 
project. 
Did you think you could create a Computer Visual Studio Project in one minute?
In the next tutorial we will expand on our VBWinformBasics project to include 
more VB.net Code and a couple more User Interface Objects and start adding mor 
detail about object Properties we use.
Happy Programming!
Rick USA
EndOfArticle:

   YourName\  
 We wil
or
Under the View menu hit W or cursor down to the item labeled Properties Window 
and hit enter on it to open the Properties Window with the Button Selected.

Cursor down to the Item

Other related posts: