<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8749066621435995088</id><updated>2024-08-27T23:30:32.901-07:00</updated><title type='text'>Visual Basic .NET for Beginners</title><subtitle type='html'>Visual Basic .NET provides the easiest, most productive language and tool for rapidly building Windows and Web applications. Visual Basic .NET comes with enhanced visual designers, increased application performance, and a powerful integrated development environment (IDE). It also supports creation of applications for wireless, Internet-enabled hand-held devices.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-7415873285345834233</id><published>2011-07-23T03:14:00.000-07:00</published><updated>2011-07-23T03:14:16.066-07:00</updated><title type='text'>Owned Forms, InputBox</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;strong&gt;&lt;u&gt;Owned Forms&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;Visual Basic&lt;/span&gt; also allows us to create owned forms. An owned form is tied to the form                                     that owns it. If you &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;minimize&lt;/span&gt; the owner form, the owned &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;form will&lt;/span&gt; also be minimized,                                     if you close the owner form, the owned form will be closed and so on. Owned &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;Forms&lt;/span&gt;                                     are &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;added&lt;/span&gt; to a form with the &lt;span style=&quot;color: blue;&quot;&gt;AddOwnedForm&lt;/span&gt; method and removed                                     with the &lt;span style=&quot;color: blue;&quot;&gt;RemoveOwnedForm&lt;/span&gt; method. The following code demonstrates                                     the creation of owned forms. Drag a Button from the toolbox onto the form (form1).                                     When you click the button, Form1 will make an object of the Form class into an owned                                     form and displays it. The code for that looks like this:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Code&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Public Class Form1 Inherits System.&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;Windows&lt;/span&gt;.Forms.Form&lt;br /&gt;
Dim OwnedForm1 As &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;New Form&lt;/span&gt;()&lt;br /&gt;
&lt;br /&gt;
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e_&lt;br /&gt;
As System.EventArgs)                                             Handles Button2.Click&lt;br /&gt;
Me.AddOwnedForm(OwnedForm1)&lt;br /&gt;
&#39;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;adding&lt;/span&gt; an owned form to the current form&lt;br /&gt;
OwnedForm1.show()&lt;br /&gt;
&#39;displaying the owned form&lt;br /&gt;
End Sub                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
The image below displays&amp;nbsp;output &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;from above&lt;/span&gt; code.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Owned Form&quot; src=&quot;http://www.startvbdotnet.com/forms/images/oform.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;InputBox Function&amp;nbsp;&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
InputBox function gets a string of text entered by the user. They are similar to the                                     JavaScript prompt windows that ask us to enter some text and &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;performs&lt;/span&gt; some action                                     after the OK button is clicked. In Visual Basic Input boxes let you display a prompt,                                     read the text entered by the user and returns a string result. The following code                                     demonstrates InputBox function. Drag a Button and TextBox control from the toolbox                                     onto the form. When you click the Button, InputBox asks to enter some text and after                                     you click OK it displays the text you entered in the TextBox. The image below displays                                     output.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Code&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Private Sub Button1_Click(ByVal sender As System.Object, ByVal e_&lt;br /&gt;
As System.EventArgs) Handles Button1.Click&lt;br /&gt;
Dim s As String = InputBox(&quot;Enter some text&quot;)&lt;br /&gt;
&#39;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;storing&lt;/span&gt; the text entered in a string&lt;br /&gt;
TextBox1.Text = s&lt;br /&gt;
&#39;displaying string in the textbox&lt;br /&gt;
End Sub                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/forms/images/ibox.gif&quot; /&gt;                                 &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/7415873285345834233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/owned-forms-inputbox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/7415873285345834233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/7415873285345834233'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/owned-forms-inputbox.html' title='Owned Forms, InputBox'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-471104497575908626</id><published>2011-07-23T03:11:00.000-07:00</published><updated>2011-07-23T03:11:34.229-07:00</updated><title type='text'>Working with Forms (Continued)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;strong&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;Adding&lt;/span&gt; a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;New Form&lt;/span&gt; to the Project&lt;/strong&gt;                                 &lt;br /&gt;
You can add a new form to the project with which you are working. To do that,&amp;nbsp;                                     select&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;File-&amp;gt;Add &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;New Item&lt;/span&gt;&lt;/span&gt; from the main menu which                                     displays a window asking you what to &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;add to&lt;/span&gt; the project. Select &lt;span style=&quot;color: blue;&quot;&gt;Windows                                     Form&lt;/span&gt; from the window and click Open to add a new form to the project. Alternatively,                                     you can add a new form with the Solution Explorer. To add a new form with the Solution                                     Explorer, right-click on the project name in Solution Explorer and Select &lt;span style=&quot;color: blue;&quot;&gt;Add-&amp;gt;Add                                     Windows Form&lt;/span&gt;. Once you finish adding a new form, if you want the form which                                     you &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;added&lt;/span&gt; to be displayed when you&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;run the&lt;/span&gt; application you need to make some                                     changes. You need to set the new form as &lt;span style=&quot;color: blue;&quot;&gt;Startup Object&lt;/span&gt;.                                     To do that,&amp;nbsp; right-click on the project name in Solution Explorer window and                                     select Properties which displays the &lt;span style=&quot;color: blue;&quot;&gt;Property Pages window&lt;/span&gt;.                                     On this window click the drop-down box which is labeled as Startup Object. Doing that                                     displays all the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;forms&lt;/span&gt; available in the project. It looks like the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Property Pages Window&quot; src=&quot;http://www.startvbdotnet.com/forms/images/propertypage.gif&quot; /&gt;                                 &lt;br /&gt;
Select the form which you want to be displayed when you run the&amp;nbsp;application and                                     click Apply. Now, when you run the application, the form&amp;nbsp;you assigned as Startup                                     object&amp;nbsp;will be displayed.                                 &lt;br /&gt;
&lt;strong&gt;Working with Multiple Forms &lt;/strong&gt;                                 &lt;br /&gt;
Let&#39;s see how we can work with more than one form/open a new form. Say, for example,                                     we want to open a new form (Form2)  when a button in the current form (Form1) is clicked.                                     To do that, open a new project by  selecting File-&amp;gt;New-&amp;gt;Project-&amp;gt;Visual  Basic-&amp;gt;WindowsApplication.                                     This &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;adds&lt;/span&gt; a form (Form1) to the application.&amp;nbsp;Add a new form (Form2) by selecting                                     File-&amp;gt;Add New Item-&amp;gt;Windows Form. Also, drag a button (Button1) onto Form1.                                     We want to open Form2 when the button in Form1 is clicked. Unlike earlier versions                                     of Visual Basic, VB .NET requires us to refer to Form2 in Form1 in order to open it                                     i.e creating an object of Form2 in Form1. The code for that looks like this:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Code&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Public Class Form1 Inherits System.Windows.Forms.Form&lt;br /&gt;
Dim other As New Form2()&lt;br /&gt;
&#39;Creating a reference to Form2&lt;br /&gt;
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As_&lt;br /&gt;
System.EventArgs) Handles Button1.Click&lt;br /&gt;
other.Show()&lt;br /&gt;
End Sub                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;strong&gt;Visual Inheritance with Forms&lt;/strong&gt;&lt;a href=&quot;&quot; name=&quot;#vh&quot;&gt; &lt;/a&gt;                                 &lt;br /&gt;
As we know, Inheritance allows us to &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;derive&lt;/span&gt; one class &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;from another&lt;/span&gt;.&amp;nbsp;VB. NET&amp;nbsp;allows                                     us to&amp;nbsp;inherit one form from another. Let&#39;s see how we can inherit a new form                                     from an existing form. Say, we have a form named Form1 with some controls on it and                                     we want to inherit a new form from that form. To derive a new form from the existing                                     one select &lt;span style=&quot;color: blue;&quot;&gt;Project-&amp;gt;Add Inherited Form&lt;/span&gt; from the main                                     menu. Doing that opens the Add New Item window. Double-click on the &lt;span style=&quot;color: blue;&quot;&gt;Inherited                                     Form Icon&lt;/span&gt; in the templates box to open the &lt;span style=&quot;color: blue;&quot;&gt;Inheritance Picker&lt;/span&gt;.                                     Inheritance Picker window looks like the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Inheritance Picker Window&quot; src=&quot;http://www.startvbdotnet.com/forms/images/ipicker.gif&quot; /&gt;                                 &lt;br /&gt;
Select Form1 in the picker and click OK. Clicking OK adds a new form, Form2, which                                     is derived from Form1. Everything on Form2 including the title is copied from Form1.&amp;nbsp;The                                     only difference between form1 and form2 is, the controls on Form2 come with a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;special&lt;/span&gt;                                     icon at the upper left corner which indicates that the form is &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;inherited&lt;/span&gt; and the controls                                     are locked. The image below displays a Inherited Form.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/forms/images/iform.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;u&gt;Inheriting a Form from Other Project&lt;/u&gt;                                 &lt;br /&gt;
You can also inherit a form from other project. To inherit a form from other project,                                     navigate to the project containing the form you want using the browse button in the                                     Inheritance Picker dialog, click the name of the DLL file containing the form and                                     click Open. This returns to the inheritance Picker dialog box where the selected project                                     is now listed. Choose the appropriate form and click OK. A new inherited form is added                                     to your project.                                 &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/471104497575908626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/working-with-forms-continued.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/471104497575908626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/471104497575908626'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/working-with-forms-continued.html' title='Working with Forms (Continued)'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-8247901200356831247</id><published>2011-07-23T03:09:00.001-07:00</published><updated>2011-07-23T03:09:57.130-07:00</updated><title type='text'>Working with Forms</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;                                     Well, let&#39;s now start working with &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;Forms&lt;/span&gt;.&amp;nbsp;When you open a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;new form&lt;/span&gt; you can have                                     a look at the default properties of the form by selecting &lt;span style=&quot;color: blue;&quot;&gt;View-&amp;gt;Properties                                     Window&lt;/span&gt; or by pressing &lt;span style=&quot;color: blue;&quot;&gt;F4&lt;/span&gt; on the keyboard. The properties                                     window opens with&amp;nbsp;default properties&amp;nbsp;set to&amp;nbsp;form by the software.                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Briefly on Properties (Categorized):&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
&lt;strong&gt;Appearance &lt;/strong&gt;                                 &lt;br /&gt;
Appearance section of the properties window allow us to make changes to the appearance                                     of the form. With the help of appearance properties we can have a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;background color&lt;/span&gt;,                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;background image&lt;/span&gt; for the entire form, set the border style for the form from a predefined                                     list, change the cursor, set the font for the text on the form and so on.                                 &lt;br /&gt;
&lt;strong&gt;Behavior&lt;/strong&gt;                                 &lt;br /&gt;
Notable Behavior property is the enabled property which lets us enable/disable the                                     form by setting the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;property to&lt;/span&gt; True/False.                                 &lt;br /&gt;
&lt;strong&gt;Layout &lt;/strong&gt;                                 &lt;br /&gt;
Layout properties are all about the structure of the form. With these properties we                                     can set the location of the form, maximum size of the form, minimum size of the form,                                     exact size of the form with the size property when designing. Note the property start                                     position, this property lets you specify the location of the form where it should                                     appear when you &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;run the&lt;/span&gt; application which you can select from a predefined list.                                 &lt;br /&gt;
&lt;strong&gt;Window Style&lt;/strong&gt;                                 &lt;br /&gt;
The notable property under this is the ControlBox property which by default it is                                     set to True. Setting the property to False makes the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;minimize&lt;/span&gt;, maximize and cancel                                     buttons on the top right side of the form &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;invisible&lt;/span&gt;.                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Form Event&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The default event of a form is the load event which looks like this in code:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Form Event&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Private Sub Form1_Load(ByVal sender As System.Object, ByVal e                                             As System.EventArgs)_&lt;br /&gt;
Handles MyBase.Load                                                 &lt;br /&gt;
&lt;br /&gt;
End Sub                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
You can write code in the load event of the form just like you write for all&amp;nbsp;other                                     controls.                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;An Example:&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
You can run the Form by selecting &lt;span style=&quot;color: blue;&quot;&gt;Debug-&amp;gt;Start&lt;/span&gt; from the                                     main menu or by pressing F5 on the keyboard. When you run a blank form with no controls                                     on it, nothing is displayed. It looks like the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Blank Form&quot; src=&quot;http://www.startvbdotnet.com/forms/images/blankform.gif&quot; /&gt;                                 &lt;br /&gt;
Now, add a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;TextBox&lt;/span&gt; and a Button to the form from the toolbox. The toolbox can be selected                                     from                                     &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;View-&amp;gt;ToolBox&lt;/span&gt;&amp;nbsp;on the main menu or by holding &lt;span style=&quot;color: blue;&quot;&gt;Ctrl+Alt+X&lt;/span&gt; on                                     the keyboard. Once &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;adding&lt;/span&gt; the TextBox and Button is done, run the form. The output                                     window displays a TextBox and a Button. When you click the Button nothing happens.                                     We need to write an event for the Button stating something should happen when you                                     click it. To do that get back to&amp;nbsp;design view&amp;nbsp;and double-click on the&amp;nbsp;                                     Button. Doing&amp;nbsp;that opens an event handler for the Button where you specify what                                     should happen when you click the button. That looks like this in code.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Code&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Public Class Form1&lt;br /&gt;
Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &quot; Windows &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;Form Designer&lt;/span&gt; generated code &quot;&lt;br /&gt;
Private Sub  Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)_&lt;br /&gt;
Handles MyBase.Load&lt;br /&gt;
End Sub&lt;br /&gt;
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _&lt;br /&gt;
System.EventArgs) Handles Button1.Click&lt;br /&gt;
End Sub&lt;br /&gt;
End Class                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Place the code &lt;strong&gt;TextBox1.Text=&quot;Welcome to Forms&quot;&lt;/strong&gt; in the Click event                                     of the Button and&amp;nbsp;run the application. When you click the Button the output &quot;Welcome                                     to Forms&quot; is displayed in the TextBox.                                 &lt;br /&gt;
Alternatively, you can also use the &lt;span style=&quot;color: blue;&quot;&gt;MsgBox&lt;/span&gt; or &lt;span style=&quot;color: blue;&quot;&gt;MessageBox&lt;/span&gt; functions                                     to &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;display text&lt;/span&gt; when you click on the Button. To do that place a Button on the form                                     and double-click on that&amp;nbsp;to open&amp;nbsp;it&#39;s event. Write this line of code, MsgBox(&quot;Welcome                                     to Forms&quot;) or MessageBox.Show(&quot;Welcome to Forms&quot;).                                     &lt;br /&gt;
&lt;br /&gt;
It looks like this in code.                                     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table5&quot; title=&quot;Code&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Private Sub Button1_Click(ByVal sender As         System.Object, ByVal e As _&lt;br /&gt;
System.EventArgs) Handles Button1.Click&lt;br /&gt;
MsgBox(&quot;Welcome to Forms&quot;)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _&lt;br /&gt;
System.EventArgs) Handles Button1.Click&lt;br /&gt;
MessageBox.Show(&quot;Welcome to Forms&quot;)&lt;br /&gt;
End Sub                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
When you run the form and click the Button, a small message box displays, &quot;Welcome                                     to Forms&quot;. The image below displays that.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/forms/images/msgbox.gif&quot; /&gt;                                 &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/8247901200356831247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/working-with-forms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/8247901200356831247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/8247901200356831247'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/working-with-forms.html' title='Working with Forms'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-3635012732093889512</id><published>2011-07-23T03:08:00.000-07:00</published><updated>2011-07-23T03:08:01.634-07:00</updated><title type='text'>Windows Form Properties</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;                                         Below are the properties of a Windows Form. Properties displayed below are categorized                                         as seen in the properties window.                                     &lt;br /&gt;
&lt;table align=&quot;Justify&quot; bgcolor=&quot;Linen&quot; border=&quot;1&quot; cellpadding=&quot;4&quot; cellspacing=&quot;4&quot; class=&quot;table&quot; id=&quot;Table1&quot; rules=&quot;all&quot; title=&quot;Windows Form Properties &quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;Maroon&quot; valign=&quot;Middle&quot; width=&quot;30%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Appearance Properties&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td bgcolor=&quot;Maroon&quot; valign=&quot;Middle&quot; width=&quot;70%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;BackColor&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;background color&lt;/span&gt; for the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;BackgroundImage&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Get/Sets the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;background image&lt;/span&gt; in the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Cursor&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the cursor to be displayed when the user moves the mouse over the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Font&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the font for the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;ForeColor&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;foreground&lt;/span&gt; color of the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;FormBorderStyle&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the border style of the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;RightToLeft&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the value indicating if the alignment of the control&#39;s elements is reversed to support right-to-left fonts&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Text&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the text associated with this form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Behavior Properties&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;AllowDrop&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Indicates if the form can accept data that the user drags and drops into it&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;ContextMenu&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;shortcut&lt;/span&gt; menu for the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Enabled&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets a value indicating if the form is enabled &lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;ImeMode&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the state of an Input Method Editor&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Data Properties&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;DataBindings&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets the data &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;bindings&lt;/span&gt; for a control&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Tag&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets an object that contains data about a control&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Design Properties&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Name&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets name for the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;DrawGrid&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Indicates whether or not to draw the positioning grid&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;GridSize&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Determines the size of the positioning grid&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Locked&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets whether the form is locked&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;SnapToGrid&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Indicates if the controls should snap to the positioning grid&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;Layout&lt;/span&gt; Properties&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;AutoScale&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Indicates if the form adjusts its size to fit the height of the font used on the form and scales its controls&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;AutoScroll&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Indicates if the form &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;implements&lt;/span&gt; autoscrolling&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;AutoScrollMargin&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;The margin around controls during auto scroll&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;AutoScrollMinSize&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;The minimum logical size for the auto scroll region&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;DockPadding&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Determines the size of the border for docked controls&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Location&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the co-ordinates of the upper-left corner of the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;MaximumSize&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;The maximum size the form can be resized to&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;MinimumSize&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;The minimum size the form can be resized to&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Size&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets size of the form in pixels&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;StartPosition&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the starting position of the form at run time&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;WindowState&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the form&#39;s window state&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Misc Properties&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;AcceptButton&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the button on the form that is pressed when the user uses the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;enter key&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;CancelButton&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Indicates the button control that is pressed when the user &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;presses&lt;/span&gt; the ESC key&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;KeyPreview&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Determines whether keyboard controls on the form are registered with the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Language&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Indicates the current localizable language&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Localizable&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Determines if localizable &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;code will&lt;/span&gt; be generated for this object&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Window Style Properties&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td bgcolor=&quot;Maroon&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;ControlBox&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets a value indicating if a control box is displayed&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;HelpButton&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Determines whether a form has a help button on the caption bar&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Icon&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the icon for the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;IsMdiContainer&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets a value indicating if the form is a container for MDI child &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;forms&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;MaximizeBox&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets a value indicating if the maximize button is displayed in the caption bar of the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Menu&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets the MainMenu that is displayed in the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;MinimizeBox&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets a value indicating if the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;minimize&lt;/span&gt; button is displayed in the caption bar of the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Opacity&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Determines how opaque or transparent the form is&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;ShowInTaskbar&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets a value indicating if the form is displayed in the Windows taskbar&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;SizeGripStyle&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Determines when the size grip will be displayed for the form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;TopMost&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Gets/Sets a value indicating if the form should be displayed as the topmost form of the application&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;TransparencyKey&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;A color which will appear transparent when painted on the form&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/3635012732093889512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/windows-form-properties.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/3635012732093889512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/3635012732093889512'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/windows-form-properties.html' title='Windows Form Properties'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-8499389581695787907</id><published>2011-07-23T03:05:00.001-07:00</published><updated>2011-07-23T03:05:57.792-07:00</updated><title type='text'>Windows Forms</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;In Visual Basic&lt;/span&gt; its these &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;Forms&lt;/span&gt; with which we work. They are the base on which we                                     build, develop all our user interface and&amp;nbsp;they come with a rich set of classes.                                     Forms allow us to work visually with controls and other items from the toolbox. In                                     VB .NET forms are based on the &lt;span style=&quot;color: blue;&quot;&gt;System.&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;Windows&lt;/span&gt;.Forms&lt;/span&gt; namespace                                     and the form class is &lt;span style=&quot;color: blue;&quot;&gt;System.Windows.Forms.Form&lt;/span&gt;. The form                                     class is based on the &lt;span style=&quot;color: blue;&quot;&gt;Control&lt;/span&gt; class which allows it to share                                     many properties and methods with other controls.                                                                                                       When we open a new project in &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;Visual Basic&lt;/span&gt; the dialogue box that appears first is                                     the one which looks like the image below. Since we are working with &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;Windows Applications&lt;/span&gt;                                     (Forms) you need to select WindowsApplication and click OK.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/forms/images/vbmain.gif&quot; /&gt;                                 &lt;br /&gt;
Once you click OK a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;new Form&lt;/span&gt; opens with the title, Form1, towards the&amp;nbsp; top-left                                     side of the form and maximize, &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;minimize&lt;/span&gt; and close buttons towards the top right of                                     the form. The whole form is surrounded with a border. The main area of the form in                                     which we work is called the &lt;span style=&quot;color: blue;&quot;&gt;Client Area&lt;/span&gt;. It&#39;s in this client                                     area we design the user interface&amp;nbsp;leaving all the code to the code behind file.                                     Forms also support events which let&#39;s the form know that something happened with the                                     form, for example, when we double-click on the form, the Form load event occurs. VB                                     .NET also &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;supports&lt;/span&gt; forms to be &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;inherited&lt;/span&gt;.                                 &lt;br /&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;Image of&lt;/span&gt; a Windows Form.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/forms/images/form.gif&quot; /&gt;                                 &lt;br /&gt;
Typically the Form looks like this in Code which is handled by the Framework.                                 &lt;br /&gt;
Public Class Form1&lt;br /&gt;
Inherits System.Windows.Forms.Form&lt;br /&gt;
&lt;br /&gt;
#Region &quot; Windows &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;Form Designer&lt;/span&gt; generated code &quot;&lt;br /&gt;
&lt;br /&gt;
Public Sub New()&lt;br /&gt;
MyBase.New()&lt;br /&gt;
&lt;br /&gt;
&#39;This call is required by the Windows Form Designer.&lt;br /&gt;
InitializeComponent()&lt;br /&gt;
&lt;br /&gt;
&#39;Add any initialization after the InitializeComponent() call&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
&#39;Form overrides dispose to clean up the component list.&lt;br /&gt;
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
If disposing Then&lt;br /&gt;
If Not (components Is Nothing) Then&lt;br /&gt;
components.Dispose()&lt;br /&gt;
End If&lt;br /&gt;
End If&lt;br /&gt;
MyBase.Dispose(disposing)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
&#39;Required by the Windows Form Designer&lt;br /&gt;
Private components As System.ComponentModel.IContainer&lt;br /&gt;
&lt;br /&gt;
&#39;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
&#39;It can be modified using the Windows Form &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;Designer&lt;/span&gt;.&lt;br /&gt;
&#39;Do not modify it using the code editor.&lt;br /&gt;
&amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub  InitializeComponent()&lt;br /&gt;
&#39;&lt;br /&gt;
&#39;Form1&lt;br /&gt;
&#39;&lt;br /&gt;
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
Me.ClientSize = New System.Drawing.Size(496, 493)&lt;br /&gt;
Me.Name = &quot;Form1&quot;&lt;br /&gt;
Me.Text = &quot;Form1&quot;&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
#End Region&lt;br /&gt;
&lt;br /&gt;
Private Sub  Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)                                                 Handles MyBase.Load&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
End Class                                         &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/8499389581695787907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/windows-forms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/8499389581695787907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/8499389581695787907'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/windows-forms.html' title='Windows Forms'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-5844723460064925050</id><published>2011-07-20T10:02:00.000-07:00</published><updated>2011-07-20T10:02:07.634-07:00</updated><title type='text'>Shortcut Keys</title><content type='html'>&lt;span class=&quot;heading&quot;&gt;&lt;/span&gt;                                         &lt;br /&gt;
&lt;table align=&quot;Justify&quot; bgcolor=&quot;Linen&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;4&quot; id=&quot;Table1&quot; title=&quot;VB .NET Shortcut Keys&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Key&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;What it Does?&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + N&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the New Project Dialogue Box&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + O&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the Open File Dialog Box&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + A&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Add New Item window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + D&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Add Existing Item window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + S &lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Saves Current Form&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + S &lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Saves everything from Application&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Alt + Q&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Exits Visual Studio. NET&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Z&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Undo&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + Z&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Redo&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + X&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Cuts your selection&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + C&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Copies your selection&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + V&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Pastes your selection&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + A&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Selects All&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Del&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Deletes your selection&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + F&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Find window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + H&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Find and Replace window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + H&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Replace in Files window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + Shift + F12&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Find Symbol window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;F7&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Code Designer window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Shift + F7&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Gets you back to Design View &lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + R&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the Solution Explorer window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + S&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the Server Explorer window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + C&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the Class View window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;F4&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the Properties window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + E&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the Resource view window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + X&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the Toolbar window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Shift + Alt + Enter&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Takes you to Full Screen View&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Alt+F8&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Macro Explorer window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;F2&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Object Browser window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + T&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Document Outline window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + K&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Task List window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + A&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Command window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + O&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Output window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + Y&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Find Symbol Results window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + F&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Lists Items under the Favorites Menu in your Internet Explorer &lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + B&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Builds your project&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;F5&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Runs your Application&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + F5&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Runs your Application without Debugging&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + E&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the Exceptions Dialog Box&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;F8&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Used while Debugging Applications&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Shift + F8&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Used While Debugging Applications&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + B&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Inserts a New Breakpoint&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + F9&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Clears All Breakpoints&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + P&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens the Processes Dialog box&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + T&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Customize Toolbox window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + P&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Runs Temporary Macro&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Shift + R&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Records Temporary Macro&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Alt + F11&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Macros IDE&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + F1&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Dynamic Help window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl +Alt + F1&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Help window sorted by Contents&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + F2&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Help window sorted by Index&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Ctrl + Alt + F3&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Help Search window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Shift + Alt + F2&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Index Results window&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Shift + Alt + F3&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Opens Search Results window&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/5844723460064925050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/shortcut-keys.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/5844723460064925050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/5844723460064925050'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/shortcut-keys.html' title='Shortcut Keys'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-3740607684766511726</id><published>2011-07-20T10:00:00.000-07:00</published><updated>2011-07-20T10:00:58.148-07:00</updated><title type='text'>Visual Studio .NET IDE</title><content type='html'>Visual Studio .NET IDE (Integrated Development &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;Environment&lt;/span&gt;) is &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;the Development&lt;/span&gt; Environment                                     for all .NET based applications which comes with rich features. VS .NET IDE provides                                     many options and is packed with many features that simplify application development                                     by handling the complexities. Visual Studio .NET IDE is an enhancement to all&amp;nbsp;previous                                     IDE’s by Microsoft.                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Important Features&lt;/u&gt;&lt;/strong&gt;&amp;nbsp;                                 &lt;br /&gt;
&lt;strong&gt;One IDE for all .NET&amp;nbsp;Projects&lt;/strong&gt;                                 &lt;br /&gt;
Visual Studio .NET IDE provides a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;single&lt;/span&gt; environment for developing all types of .NET                                     applications. Application’s range from single &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;windows applications&lt;/span&gt; to complex n-tier                                     applications and rich web applications.                                 &lt;br /&gt;
&lt;strong&gt;Option to choose from Multiple Programming Languages&lt;/strong&gt;                                 &lt;br /&gt;
You can choose the programming language of your choice to develop applications based                                     on your expertise in that language. You can also incorporate multiple programming                                     languages in one .NET solution and edit that with the IDE.                                 &lt;br /&gt;
&lt;strong&gt;IDE is Customizable&lt;/strong&gt;                                 &lt;br /&gt;
You can customize the IDE based on your preferences. The &lt;span style=&quot;color: blue;&quot;&gt;My Profile&lt;/span&gt; settings                                     allow you to do this. With these settings you can set the IDE screen the way you want,                                     the way &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;the keyboard&lt;/span&gt; behaves and you can also filter the help files based on the language                                     of your choice.                                 &lt;br /&gt;
&lt;strong&gt;Built-in Browser&lt;/strong&gt;                                 &lt;br /&gt;
The IDE comes with a built-in browser that helps you browse the Internet without launching                                     another application. You can look for additional resources, online help files, source                                     codes and much more with this built-in browser feature.                                 &lt;br /&gt;
When we open VS .NET from &lt;span style=&quot;color: blue;&quot;&gt;Start-&amp;gt;Programs-&amp;gt;Microsoft Visual                                     Studio .NET-&amp;gt;Microsoft Visual Studio .NET&lt;/span&gt; &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;the window&lt;/span&gt; that is displayed first                                     is the &lt;span style=&quot;color: blue;&quot;&gt;Start Page&lt;/span&gt;&amp;nbsp;which is shown below. The start Page                                     allows us to select from the most recent projects (last four projects) with which                                     we worked or it can be customized&amp;nbsp;based on your preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;StartPage&quot; src=&quot;http://www.startvbdotnet.com/language/images/startpage.gif&quot; /&gt;                                 &lt;br /&gt;
The &lt;span style=&quot;color: blue;&quot;&gt;Integrated Development Environment&lt;/span&gt; (IDE)&amp;nbsp;shown                                     in the image below is what we &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;actually&lt;/span&gt; work with. This IDE is shared by all&amp;nbsp;programming                                     languages in Visual Studio. You can view the toolbars towards the left side of the                                     image along with the Solution Explorer window towards the right.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;IDE&quot; src=&quot;http://www.startvbdotnet.com/language/images/ide.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;New Project Dialogue Box&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
The New Project dialogue box like the one in the image below is used to create a new                                     project specifying it&#39;s type allowing us to name the project and also &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;specify&lt;/span&gt; it&#39;s                                     location on the disk where it is saved. The default location on the hard disk where                                     all the projects are saved is &lt;span style=&quot;color: blue;&quot;&gt;C:\DocumentsandSettings\Administrator\MyDocuments\VisualStudioProjects&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;New Project Dialogue&quot; src=&quot;http://www.startvbdotnet.com/language/images/vbmain.gif&quot; /&gt;                                 &lt;br /&gt;
Following are different templates under Project Types and&amp;nbsp;their use.                                 &lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;Windows Application&lt;/span&gt;&lt;/strong&gt;: This template allows to create standard windows                                     based applications.                                 &lt;br /&gt;
&lt;strong&gt;Class Library&lt;/strong&gt;: Class libraries are those that provide functionality                                     similar to Active X and DLL by creating classes that access other applications.                                 &lt;br /&gt;
&lt;strong&gt;Windows Control Library&lt;/strong&gt;: This allows to create our own windows controls.                                     Also called as User Controls, where you group some controls, add it to &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;the toolbox&lt;/span&gt;                                     and make it available to other projects.                                 &lt;br /&gt;
&lt;strong&gt;ASP .NET Web Application&lt;/strong&gt;: This allows to create web-based applications                                     using IIS. We can create web pages, rich web applications and web services.                                 &lt;br /&gt;
&lt;strong&gt;ASP .NET Web Service&lt;/strong&gt;: Allows to create &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;XML Web Services&lt;/span&gt;.                                 &lt;br /&gt;
&lt;strong&gt;Web Control Library&lt;/strong&gt;: Allows to create User-defined controls for the                                     Web. Similar to user defined windows controls but these are used for Web.                                 &lt;br /&gt;
&lt;strong&gt;Console Application&lt;/strong&gt;: A new kind of application in Visual Studio .NET.                                     They are command line based applications.                                 &lt;br /&gt;
&lt;strong&gt;Windows Service&lt;/strong&gt;: These run continuously regardless of the user interaction.                                     They are designed for special purpose and once written, will keep running and come                                     to an end only when the system is shut down.                                 &lt;br /&gt;
&lt;strong&gt;Other&lt;/strong&gt;: This template is to develop other &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;kinds of&lt;/span&gt; applications like                                     enterprise applications, database applications etc.&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Solution Explorer Window&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
The Solution Explorer window gives an overview of the solution we are working with                                     and lists all the files in the project. An image of the Solution Explorer window is                                     shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Solution Explorer Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/solexp.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Server Explorer Window&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The Server Explorer window is a great tool that provides &quot;drag and drop&quot; feature and                                     helps us work with databases in an easy graphical &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;environment&lt;/span&gt;. For example, if we                                     drag and drop a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;database table&lt;/span&gt; onto a form, VB .NET automatically creates connection                                     and command objects that are needed to access that table. The image below displays                                     Server Explorer window.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Server Explorer Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/serverexpl.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Intellisense&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
Intellisense is what that is responsible for the boxes that open as we&amp;nbsp;type the                                     code. IntelliSense provides a list of options that make language references easily                                     accessible and&amp;nbsp;helps us to find the information we need. They also complete the                                     typing for us. The image below displays that.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Intellisense&quot; src=&quot;http://www.startvbdotnet.com/language/images/intellisense.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Code Designer Window&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
Code Designers like the image below allows us to edit and write code. This is &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;the                                     window&lt;/span&gt; that opens when we double-click on a form or any control. This is the place                                     where we write all the code for the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;application&lt;/span&gt;. Notice the two drop-down list boxes                                     at the top of the code window in the image below. The left box allows us to select                                     the object&#39;s code we are working with and the right box allows us to select the part                                     of code that we want to work. Also notice the &quot;+&quot; and &quot;-&quot; boxes in the code designer.                                     You can use those boxes to display code Visual Basic .NET already created, like, Windows                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;Forms&lt;/span&gt; Designer generated code, etc.                                     &lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Code Designer Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/codedesigner.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Properties Window&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;The properties&lt;/span&gt; window allows us to set properties for various objects at design time.                                     For example, if you want to change the font, &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;font size&lt;/span&gt;, backcolor, name, text that                                     appears on &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;a button&lt;/span&gt;, textbox etc, you can do that in this window. Below is the image                                     of properties window. You can view the properties window by selecting&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;View-&amp;gt;Properties Window&lt;/span&gt; from the main menu or by pressing &lt;span style=&quot;color: blue;&quot;&gt;F4 &lt;/span&gt;on                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;the keyboard&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Properties Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/properties.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Dynamic Help Window&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The dynamic help window displays help which looks up for things automatically. For                                     example, if you want to &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;get help&lt;/span&gt; with a form, select the form and select &lt;span style=&quot;color: blue;&quot;&gt;Help-&amp;gt;Dynamic                                     Help&lt;/span&gt; from the main menu. Doing that displays all the information relating to                                     forms. The image below displays that. You can get help relating to anything with this                                     feature. Say, if you want to know more about the&amp;nbsp;form, select the&amp;nbsp;form and                                     select Dynamic Help from the Help menu. Doing&amp;nbsp;that &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;displays information&lt;/span&gt; about                                     the&amp;nbsp;form as shown in the image below..                                     &lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Dynamic Help Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/dynamichelp.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Command Window&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
The &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;command&lt;/span&gt; &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;window&lt;/span&gt; in &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;the image&lt;/span&gt; &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;below&lt;/span&gt; is a useful window. Using this window we can                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;add new&lt;/span&gt; item to the project, add &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;new project&lt;/span&gt; and so on. &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;You can&lt;/span&gt; view the command window                                     by selecting                                     &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;View-&amp;gt;Other &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;Windows&lt;/span&gt;-&amp;gt;Command Window&lt;/span&gt; from the main                                     menu. The command window in the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;image&lt;/span&gt; &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;displays&lt;/span&gt; all possible commands with File.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Command Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/commandwindow.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Task List Window&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;task list&lt;/span&gt; window displays all the tasks that VB .NET assumes we still have to                                     finish. You can view the task list window by selecting &lt;span style=&quot;color: blue;&quot;&gt;View-&amp;gt;Show                                     tasks-&amp;gt;All&lt;/span&gt; or &lt;span style=&quot;color: blue;&quot;&gt;View-&amp;gt;Other Windows-&amp;gt;Task List&lt;/span&gt; from                                     the main menu. The image below shows that. As you can see from the image, the task                                     list displayed &quot;TextBox1 not declared&quot;, &quot;RichTextBox1 not declared&quot;. The reason for                                     that message is, there were no controls on the form and attempts where made to write                                     code for a textbox and a richtextbox. Task list also displays syntax errors and other                                     errors you normally encounter during coding&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;TaskList Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/tasklist.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Class View Window&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
The class view window like the image below is the window that presents solutions and                                     projects in terms of the classes they contain and the members of these classes. Using                                     the class view window also helps us to find a member of a class that we want to work                                     with. As you can notice from the image, the class view window displayed all the methods                                     and events for the controls which were available on the form.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Class View Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/classview.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Output Window&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
The output window as you can see in the image below displays the results of building                                     and running applications.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Output Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/output.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Object Explorer Window&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The object explorer window allows us to view all the members of an object at once.                                     It lists all the objects in our code and gives us access to them. The image below                                     displays an object explorer window. You can view the object explorer window by selecting &lt;span style=&quot;color: blue;&quot;&gt;View-&amp;gt;Other                                     Windows-&amp;gt; Object Browser&lt;/span&gt; from the main menu.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Object Explorer Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/objectexplorer.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Toolbox Window&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
The toolbox window is the window that gives us access to all controls, components,                                     etc. As you can see from the image below, the toolbox uses tabs to divide it&#39;s contents                                     into categories (Data, Components, Windows Forms and General). The Data tab displays                                     tools for creating datasets and making data connections, the Windows Forms tab displays                                     tools for adding controls to forms, the General tab is left empty by default, the                                     Clipboard Ring tab displays recent items stored in the clipboard and allows us to                                     select from them.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Toolbox Window&quot; src=&quot;http://www.startvbdotnet.com/language/images/toolbox.gif&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/3740607684766511726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/visual-studio-net-ide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/3740607684766511726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/3740607684766511726'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/visual-studio-net-ide.html' title='Visual Studio .NET IDE'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-6735724833730899975</id><published>2011-07-20T09:58:00.001-07:00</published><updated>2011-07-20T09:58:32.835-07:00</updated><title type='text'>Strings, Math Functions</title><content type='html'>&lt;u&gt;&lt;strong&gt;Strings&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
Strings &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;in Visual Basic&lt;/span&gt; are supported by the .NET &lt;span style=&quot;color: blue;&quot;&gt;String&lt;/span&gt; class.                                     The String &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;data type&lt;/span&gt; can represent a series of characters and can contain approximately                                     up to &lt;span style=&quot;color: blue;&quot;&gt;2 billion&lt;/span&gt; Unicode characters. There are many built-in                                     functions in the String class. Some .&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;NET Framework&lt;/span&gt; functions are also built into the                                     String class. The following code puts some String functions to work.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Strings in VB .NET&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;Imports&lt;/span&gt; System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim string1 As String = &quot;Strings in Visual Basic&quot;&lt;br /&gt;
Dim string2 As String&lt;br /&gt;
Dim string3 As String&lt;br /&gt;
Dim string4 As String&lt;br /&gt;
Dim string5 As String&lt;br /&gt;
Dim string6 As String&lt;br /&gt;
string2 = UCase(string1)&lt;br /&gt;
&#39;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;converts&lt;/span&gt; string to uppercase&lt;br /&gt;
string3 = LCase(string1)&lt;br /&gt;
&#39;converts string to lowercase&lt;br /&gt;
string4 = string1.Substring(11, 6)&lt;br /&gt;
&#39;returns a substring&lt;br /&gt;
string5 = string1.Clone&lt;br /&gt;
&#39;clones a string&lt;br /&gt;
string6 = string1.GetHashCode&lt;br /&gt;
&#39;gets the hashcode&lt;br /&gt;
WriteLine(string2)&lt;br /&gt;
WriteLine(string3)&lt;br /&gt;
WriteLine(string4)&lt;br /&gt;
WriteLine(string5)&lt;br /&gt;
WriteLine(string6)&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/strings.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Math Functions&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
Visual Basic&amp;nbsp;provides support for handling Mathematical calculations. Math functions                                     are stored in &lt;span style=&quot;color: blue;&quot;&gt;System.Math&lt;/span&gt; &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;namespace&lt;/span&gt;. We need to import this                                     namespace&amp;nbsp; when we work with Math functions. The functions built into &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;Math class&lt;/span&gt;                                     helps us calculate the Trigonometry values, Square roots,&amp;nbsp; logarithm values,                                     etc. The following code puts some Math functions to work.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Math Functions in VB .NET&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Imports System.Math&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
WriteLine(&quot;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;Sine&lt;/span&gt; 90 is&quot; &amp;amp; &quot; &quot; &amp;amp; Sin(90))&lt;br /&gt;
&#39;display Sine90 value&lt;br /&gt;
WriteLine(&quot;Square root of 81 is &quot; &amp;amp; &quot; &quot; &amp;amp; Sqrt(81))&lt;br /&gt;
&#39;displays square root of 81&lt;br /&gt;
WriteLine(&quot;Log &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;value of&lt;/span&gt; 12 is&quot; &amp;amp; &quot; &quot; &amp;amp; Log(12))&lt;br /&gt;
&#39;displays the logarithm value of 12&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/math.gif&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/6735724833730899975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/strings-math-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6735724833730899975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6735724833730899975'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/strings-math-functions.html' title='Strings, Math Functions'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-6351801545460497606</id><published>2011-07-20T09:57:00.001-07:00</published><updated>2011-07-20T09:57:40.327-07:00</updated><title type='text'>Arrays</title><content type='html'>&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;Arrays&lt;/span&gt; are programming constructs that store data and allow us to access them by numeric &lt;span style=&quot;color: blue;&quot;&gt;index &lt;/span&gt;or &lt;span style=&quot;color: blue;&quot;&gt;subscript&lt;/span&gt;.                                     Arrays helps us create shorter and simpler code in many situations. Arrays &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;in Visual                                     Basic&lt;/span&gt; .NET inherit from the &lt;span style=&quot;color: blue;&quot;&gt;Array&lt;/span&gt; class in the System namespace.                                     All arrays in VB are &lt;span style=&quot;color: blue;&quot;&gt;zero based&lt;/span&gt;, meaning, the index of the                                     first element is zero and they are numbered sequentially. You must &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;specify&lt;/span&gt; the number                                     of &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;array&lt;/span&gt; elements by indicating the upper bound of the array. The upper bound is the                                     numder that specifies the index of the last element of the array.&amp;nbsp;Arrays are                                     declared using Dim, ReDim, Static, Private, Public and Protected keywords. An array                                     can have &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;one dimension&lt;/span&gt; (liinear arrays)&amp;nbsp;or more than one (&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;multidimensional&lt;/span&gt; arrays).                                     The dimensionality of an array refers to the number of subscripts used to identify                                     an individual element. In Visual Basic we can specify up to 32 dimensions. Arrays                                     do not have fixed size in Visual Basic.                                 &lt;br /&gt;
The following code demonstrates arrays.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Arrays&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim sport(5) As String&lt;br /&gt;
&#39;declaring an array&lt;br /&gt;
sport(0) = &quot;Soccer&quot;&lt;br /&gt;
sport(1) = &quot;Cricket&quot;&lt;br /&gt;
sport(2) = &quot;Rugby&quot;&lt;br /&gt;
sport(3) = &quot;Aussie Rules&quot;&lt;br /&gt;
sport(4) = &quot;BasketBall&quot;&lt;br /&gt;
sport(5) = &quot;Hockey&quot;&lt;br /&gt;
&#39;storing values in the array&lt;br /&gt;
WriteLine(&quot;Name of the Sport in the third location&quot; &amp;amp; &quot; &quot; &amp;amp; sport(2))&lt;br /&gt;
&#39;displaying value from array&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;strong&gt;Understanding the Code&lt;/strong&gt;                                 &lt;br /&gt;
The above code declared a sport array of type string like this: &lt;strong&gt;Dim sport(5)                                     as String&lt;/strong&gt;. This sport array has 6 elements starting from sport(0) to sport(5).                                     The first element of an array is always referred by zero index. The image below displays                                     output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/array.gif&quot; /&gt;                                 &lt;br /&gt;
You can also declare an array without specifying the number of elements on one line,                                     you must provide values for each element when initializing the array. The following                                     lines demonstrate that:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Arrays&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;  Dim Test() as &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;Integer&lt;/span&gt;&lt;br /&gt;
&#39;declaring a Test array&lt;br /&gt;
Test=New Integer(){1,3,5,7,9,}                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;strong&gt;Reinitializing Arrays&lt;/strong&gt;                                 &lt;br /&gt;
&lt;br /&gt;
We can change the size of an array after&amp;nbsp;creating them. The &lt;span style=&quot;color: blue;&quot;&gt;ReDim &lt;/span&gt;statement                                     assigns a completely new array object to the specified array variable. You use&amp;nbsp;ReDim                                     statement to change the number of elements in an array. The following lines of code                                     demonstrate that.&amp;nbsp;This code reinitializes the Test array declared above.&amp;nbsp;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table4&quot; title=&quot;ReDim Statement&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Dim Test(10) as Integer&lt;br /&gt;
ReDim Test(25) as Integer&lt;br /&gt;
&#39;Reinitializing the array                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
When&amp;nbsp;using the Redim statement all the data contained in the array is lost. If                                     you want to preserve existing data when reinitializing an array then you&amp;nbsp;should                                     use the &lt;span style=&quot;color: blue;&quot;&gt;Preserve&lt;/span&gt; keyword which&amp;nbsp;looks like this:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table5&quot; title=&quot;ReDim with Preserve Keyword&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                          Dim Test() as Integer={1,3,5}&lt;br /&gt;
&#39;declares an array an initializes it with three members&lt;br /&gt;
ReDim Preserve Test(25)&lt;br /&gt;
&#39;resizes the array and retains the the data in elements 0 to 2                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Multidimensional Arrays&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
All arrays which were &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;mentioned&lt;/span&gt; above are one &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;dimensional&lt;/span&gt;&amp;nbsp;or linear arrays. There                                     are two &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;kinds of&lt;/span&gt; multidimensional arrays supported by the .&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;NET framework&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;Rectangular                                     arrays&lt;/span&gt; and &lt;span style=&quot;color: blue;&quot;&gt;Jagged arrays&lt;/span&gt;.                                 &lt;br /&gt;
&lt;strong&gt;Rectangular arrays&lt;/strong&gt;                                 &lt;br /&gt;
Rectangular arrays are arrays in which each member of each dimension is extended in                                     each other dimension by the same length. We declare a rectangular array by specifying                                     additional dimensions at declaration. The following lines of code demonstrate the                                     declaration of a multidimensional array.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table6&quot; title=&quot;Rectangular Arrays&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Dim rectArray(4, 2) As Integer&lt;br /&gt;
&#39;declares an array of 5 by 3 members which is a 15 member array&lt;br /&gt;
Dim rectArray(,) As Integer = {{1, 2, 3}, {12, 13, 14}, {11, 10, 9}}&lt;br /&gt;
&#39;setting initial values                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;strong&gt;Jagged Arrays&lt;/strong&gt;                                 &lt;br /&gt;
Another type of multidimensional array, Jagged Array, is an array of arrays in which                                     the length of each array can differ. Example where &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;this array&lt;/span&gt; can be used is to create                                     a table in which the number of columns differ in each row. Say, if row1 has 3 columns,                                     row2&amp;nbsp;has&amp;nbsp;3 columns then&amp;nbsp;row3 can have 4 columns, row4 can have&amp;nbsp;5                                     columns and so on. The following code demonstrates jagged arrays.                                 &lt;br /&gt;
Dim colors(2)() as String&lt;br /&gt;
&#39;declaring an array of 3 arrays&lt;br /&gt;
colors(0)=New String(){&quot;Red&quot;,&quot;blue&quot;,&quot;Green&quot;}&lt;br /&gt;
initializing the first array to 3 members and setting values&lt;br /&gt;
colors(1)=New String(){&quot;Yellow&quot;,&quot;Purple&quot;,&quot;Green&quot;,&quot;Violet&quot;}&lt;br /&gt;
initializing the second array to 4 members and setting values&lt;br /&gt;
colors(2)=New String(){&quot;Red&quot;,&quot;Black&quot;,&quot;White&quot;,&quot;Grey&quot;,&quot;Aqua&quot;}&lt;br /&gt;
initializing the third array to 5 members and setting values</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/6351801545460497606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/arrays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6351801545460497606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6351801545460497606'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/arrays.html' title='Arrays'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-2164207204145551855</id><published>2011-07-20T09:55:00.000-07:00</published><updated>2011-07-20T09:55:26.265-07:00</updated><title type='text'>Enumeration, Exception Handling</title><content type='html'>&lt;u&gt;&lt;strong&gt;Enumeration &lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
Enumeration is a related set of constants. They are used when working with many constants                                     of the same type. It&#39;s&amp;nbsp; declared with the &lt;span style=&quot;color: blue;&quot;&gt;Enum&lt;/span&gt; keyword.                                 &lt;br /&gt;
Example                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Enumeration&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Enum Seasons&lt;br /&gt;
Summer = 1&lt;br /&gt;
Winter = 2&lt;br /&gt;
Spring = 3&lt;br /&gt;
Autumn = 4&lt;br /&gt;
End Enum&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Write(&quot;Summer is the&quot; &amp;amp; Seasons.Summer &amp;amp; &quot;season&quot;)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Output of&amp;nbsp;above code is&amp;nbsp;the image below. To use a constant from the enumeration                                     it should be referred like this, &lt;span style=&quot;color: blue;&quot;&gt;Seasons.Winter &lt;/span&gt;and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/enum.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Constants&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
When we have certain values that we frequently use while programming, we should use                                     Constants. A value declared as constant is of fixed value that cannot be changed once                                     set. Constants should be declared as &lt;span style=&quot;color: blue;&quot;&gt;Public&lt;/span&gt; if we want it                                     to be accessed by all parts of the application. In Visual Basic .NET we use the &lt;span style=&quot;color: blue;&quot;&gt;Const&lt;/span&gt; keyword                                     to declare a constant. The following line of code declares a constant: &lt;strong&gt;Public                                     Const Pi as Double=3.14159265&lt;/strong&gt;                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Exception Handling&lt;/strong&gt;&lt;/u&gt;&lt;a href=&quot;&quot; name=&quot;#eh&quot;&gt; &lt;/a&gt;                                 &lt;br /&gt;
Exceptions are runtime errors that occur when a program is running and causes the                                     program to abort without execution. Such kind of situations can be handled using Exception                                     Handling. By placing specific lines of code in the application we can handle most                                     of the errors that we may encounter and we can enable the application to continue                                     running. VB .NET supports two ways to&amp;nbsp;handle exceptions, &lt;span style=&quot;color: blue;&quot;&gt;Unstructured&lt;/span&gt; exception                                     Handling using the &lt;span style=&quot;color: blue;&quot;&gt;on error goto&lt;/span&gt; statement and &lt;span style=&quot;color: blue;&quot;&gt;Structured&lt;/span&gt; exception                                     handling using &lt;span style=&quot;color: blue;&quot;&gt;Try....Catch.....Finally&lt;/span&gt;                                 &lt;br /&gt;
Let&#39;s look at the new kind of exception handling introduced in VB .NET which is the                                     Structured Exception Handling. VB .NET uses Try....Catch....Finally block type exception                                     handling. The syntax looks like this:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Module Module1&lt;br /&gt;
Sub Main()&lt;br /&gt;
Try&lt;br /&gt;
-&lt;br /&gt;
-&lt;br /&gt;
Catch e as Exception&lt;br /&gt;
-&lt;br /&gt;
-&lt;br /&gt;
Finally&lt;br /&gt;
End Try&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;End Module&lt;/span&gt;                                 &lt;br /&gt;
Example                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Exception Handling&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim a = 0, b = 1, c As Integer&lt;br /&gt;
Try&lt;br /&gt;
c = b / a&lt;br /&gt;
&#39;the above line throws an exception&lt;br /&gt;
WriteLine(&quot;C is &quot; &amp;amp; c)&lt;br /&gt;
Catch e As Exception&lt;br /&gt;
WriteLine(e)&lt;br /&gt;
&#39;catching the exception&lt;br /&gt;
End Try&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The output of the above code displays a message stating the exception. The reason                                     for the exception is because any number divided by zero is infinity. When working                                     with Structured exception handling you can have multiple Catch blocks to handle different                                     types of exceptions differently. The code in the Finally block is optional. If there                                     is a Finally block in the code then that code is executed last.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/eh.gif&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/2164207204145551855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/enumeration-exception-handling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/2164207204145551855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/2164207204145551855'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/enumeration-exception-handling.html' title='Enumeration, Exception Handling'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-7271747923386024147</id><published>2011-07-20T09:54:00.000-07:00</published><updated>2011-07-20T09:54:23.011-07:00</updated><title type='text'>Operators</title><content type='html'>&lt;strong&gt;&lt;u&gt;Code Samples&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
&lt;strong&gt;Arithmetic Operators &lt;/strong&gt;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Arithmetic Operators&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim x, y, z As Integer&lt;br /&gt;
x = 30&lt;br /&gt;
y = 20&lt;br /&gt;
z = x + y&lt;br /&gt;
WriteLine(&quot;Addition&quot; &amp;amp; &quot; = &quot; &amp;amp; z)&lt;br /&gt;
z = x - y&lt;br /&gt;
WriteLine(&quot;Subtraction&quot; &amp;amp; &quot; = &quot; &amp;amp; z)&lt;br /&gt;
z = x * y&lt;br /&gt;
WriteLine(&quot;Multiplication&quot; &amp;amp; &quot; = &quot; &amp;amp; z)&lt;br /&gt;
z = x / y&lt;br /&gt;
WriteLine(&quot;Division&quot; &amp;amp; &quot; = &quot; &amp;amp; z)&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/ao.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Concatenation Operators&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Concatenation Operators&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim str1, str2, str3, str4 As String&lt;br /&gt;
str1 = &quot;Concatenation&quot;&lt;br /&gt;
str2 = &quot;Operators&quot;&lt;br /&gt;
str3 = str1 + str2&lt;br /&gt;
WriteLine(str3)&lt;br /&gt;
str4 = str1 &amp;amp; str2&lt;br /&gt;
WriteLine(str4)&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/co.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Comparison Operators&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table4&quot; title=&quot;Comparision Operators&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim x, y As Integer&lt;br /&gt;
WriteLine(&quot;enter values for x and y &quot;)&lt;br /&gt;
x = Val(ReadLine())&lt;br /&gt;
y = Val(ReadLine())&lt;br /&gt;
If x = y Then&lt;br /&gt;
WriteLine(&quot;x is equal to y&quot;)&lt;br /&gt;
ElseIf x &amp;lt; y Then&lt;br /&gt;
WriteLine(&quot;x is less than y&quot;)&lt;br /&gt;
ElseIf x &amp;gt; y Then&lt;br /&gt;
WriteLine(&quot;x is greater than y&quot;)&lt;br /&gt;
End If&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/como.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Logical / Bitwise Operators&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table5&quot; title=&quot;Logical/Bitwise Operators&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim x As Boolean&lt;br /&gt;
x = Not 45 &amp;gt; 26&lt;br /&gt;
WriteLine(&quot;x not is false&quot;)&lt;br /&gt;
&#39; x equals false&lt;br /&gt;
x = Not 26 &amp;gt; 87&lt;br /&gt;
&#39; x equals True&lt;br /&gt;
WriteLine(&quot;x not is true&quot;)&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/bo.gif&quot; /&gt;&amp;nbsp;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/7271747923386024147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/operators_20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/7271747923386024147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/7271747923386024147'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/operators_20.html' title='Operators'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-6629284209695400165</id><published>2011-07-20T09:53:00.001-07:00</published><updated>2011-07-20T09:53:16.864-07:00</updated><title type='text'>Operators</title><content type='html'>Visual Basic comes with many built-in operators that allow us to manipulate data.                                     An operator performs a function on &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;one or&lt;/span&gt; more operands. For example, we add two variables                                     with the &quot;+&quot; addition operator and &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;store the&lt;/span&gt; result in a third variable with the &quot;=&quot;                                     assignment operator like this: int x + int y = int z. The two variables (x ,y)&amp;nbsp;are                                     called operands. There are&amp;nbsp;different types of operators &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;in Visual Basic&lt;/span&gt; and they                                     are described below in the order of their precedence.                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Arithmetic Operators&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
Arithmetic operators are used to perform arithmetic operations that involve calculation                                     of numeric values. The table below summarizes them:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;Justify&quot; bgcolor=&quot;Linen&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;4&quot; id=&quot;Table1&quot; title=&quot;Arithmetic Operators&quot;&gt;&lt;tbody&gt;
&lt;tr bgcolor=&quot;Maroon&quot;&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Operator&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Use&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;^&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Exponentiation&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;-&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Negation (used to reverse the sign of the given value, exp -intValue)&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;*&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Multiplication&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;/&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Division&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;\&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;Integer&lt;/span&gt; Division&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Mod&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Modulus Arithmetic&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;+&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Addition&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;-&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;Subtraction&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Concatenation Operators&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
Concatenation operators join multiple strings into a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;single&lt;/span&gt; string. There are two                                     concatenation operators, + and &amp;amp; as summarized below:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;Justify&quot; bgcolor=&quot;Linen&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;4&quot; id=&quot;Table3&quot; title=&quot;Concatenation Operators&quot;&gt;&lt;tbody&gt;
&lt;tr bgcolor=&quot;Maroon&quot;&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Operator&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;70%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Use&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;String Concatenation&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;&amp;amp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;String Concatenation&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Comparison Operators&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
A comparison operator compares operands and returns a logical value based on whether                                     the comparison is true or not. The table below summarizes them:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;Justify&quot; bgcolor=&quot;Linen&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;4&quot; id=&quot;Table4&quot; title=&quot;Comparision Operators&quot;&gt;&lt;tbody&gt;
&lt;tr bgcolor=&quot;Maroon&quot;&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Operator&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;Use&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt; Equality&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Inequality&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Less than&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Greater than&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;Greater than or equal to&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: x-small;&quot;&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;Less than&lt;/span&gt; or equal to&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Logical / Bitwise Operators&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The logical operators compare Boolean expressions and return a Boolean result. In                                     short, logical operators are expressions which return a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;true or false&lt;/span&gt; result over                                     a conditional expression. The table below summarizes them:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;Justify&quot; bgcolor=&quot;Linen&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;4&quot; id=&quot;Table5&quot; title=&quot;Logical/Bitwise Operators&quot;&gt;&lt;tbody&gt;
&lt;tr bgcolor=&quot;Maroon&quot;&gt;   &lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Operator&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Use&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Not&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt; Negation&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;And&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Conjunction&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;AndAlso&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Conjunction&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Or&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt; Disjunction&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;OrElse&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt; Disjunction&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt;Xor&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: xx-small;&quot;&gt; Disjunction&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/6629284209695400165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/operators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6629284209695400165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6629284209695400165'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/operators.html' title='Operators'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-5960020686766340350</id><published>2011-07-20T09:51:00.001-07:00</published><updated>2011-07-20T09:51:56.185-07:00</updated><title type='text'>Data Type Conversion, File Extensions</title><content type='html'>&lt;u&gt;&lt;strong&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;Converting&lt;/span&gt; between Data types&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;In Visual Basic&lt;/span&gt;, data can be converted in two ways: &lt;span style=&quot;color: blue;&quot;&gt;implicitly&lt;/span&gt;,                                     which means the conversion is performed automatically, and &lt;span style=&quot;color: blue;&quot;&gt;explicitly&lt;/span&gt;,                                     which means you must perform the conversion.                                 &lt;br /&gt;
&lt;strong&gt;Implict Conversions&lt;/strong&gt;                                 &lt;br /&gt;
Let&#39;s understand implicit conversions&amp;nbsp;in code. The example below declares two                                     variable, one of type double and the other &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;integer&lt;/span&gt;. The double data type is assigned                                     a value and is converted to integer type. When you run the code the result displayed                                     is an integer value, in this case the value displayed is 132 instead of 132.31223.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Code&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim d=132.31223 as Double&lt;br /&gt;
Dim i as Integer&lt;br /&gt;
i=d&lt;br /&gt;
WriteLine(&quot;Integer value is&quot; &amp;amp; i)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;strong&gt;Explicit Conversions&lt;/strong&gt;                                 &lt;br /&gt;
When types cannot be implicitly converted you should convert them explicitly. This                                     conversion is also called as &lt;span style=&quot;color: blue;&quot;&gt;cast&lt;/span&gt;. Explicit &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;conversions&lt;/span&gt;                                     are &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;accomplished&lt;/span&gt; using &lt;span style=&quot;color: blue;&quot;&gt;CType &lt;/span&gt;function.                                 &lt;br /&gt;
&lt;u&gt;CType function for conversion&lt;/u&gt;                                 &lt;br /&gt;
If we are not sure of the name of a particular conversion function then we can use                                     the &lt;span style=&quot;color: blue;&quot;&gt;CType&lt;/span&gt; function. The&amp;nbsp;above example with a CType                                     function looks like this:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;CType Function&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim d As Double&lt;br /&gt;
d = 132.31223&lt;br /&gt;
Dim i As Integer&lt;br /&gt;
i = CType(d, i)&lt;br /&gt;
&#39;two arguments, type we are converting from, to type desired&lt;br /&gt;
WriteLine(&quot;Integer value is&quot; &amp;amp; i)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Below is the list of conversion functions which we can use in VB .NET.                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CBool &lt;/span&gt;- use this function to convert to Bool data type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CByte&lt;/span&gt; - use this function to convert to Byte data type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CChar&lt;/span&gt; - use this function to convert to Char data type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CDate&lt;/span&gt; - use this function to convert to Date type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CDbl&lt;/span&gt; - use this function to convert to Double data type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CDec&lt;/span&gt; - use this function to convert to Decimal data type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CInt&lt;/span&gt; - use this function to convert to Integer data type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CLng&lt;/span&gt; - use this function to convert to Long data type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CObj&lt;/span&gt; - use this function to convert to Object type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CShort&lt;/span&gt; - use this function to convert to Short data type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CSng&lt;/span&gt; - use this function to convert to &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;Single&lt;/span&gt; data type&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;CString&lt;/span&gt; - use this function to convert to String data type                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Attributes&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
Attributes are&amp;nbsp; those that lets us specify information about the items we are                                     using in VB .NET. Attributes are &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;enclosed&lt;/span&gt; in angle brackets(&amp;lt; &amp;gt;) and are used                                     when VB .NET needs to know more beyond the standard syntax.                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;File Extensions in VB .NET&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The files and their extensions which are created as part of the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;Windows Application&lt;/span&gt;                                     Project and their meaning are summarized below:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;.vbproj&lt;/span&gt;-&amp;gt;A &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;Visual Basic project&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Form1.vb&lt;/span&gt;-&amp;gt;A form&#39;s code&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;AssemblyInfo.VB&lt;/span&gt;-&amp;gt;Information about an assembly, includes                                     version information&lt;br /&gt;
.&lt;span style=&quot;color: blue;&quot;&gt;vbproj.user&lt;/span&gt;-&amp;gt;Stores project user options&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;.sln&lt;/span&gt;-&amp;gt;Solution file which stores solution&#39;s configuration&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;.suo&lt;/span&gt;-&amp;gt; Stores Solution user options&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Form1.resx.NET&lt;/span&gt;-&amp;gt;XML based resource template&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;bin&lt;/span&gt; directory-&amp;gt;Directory for binary executables&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;obj&lt;/span&gt; directory-&amp;gt;Directory for debugging binaries                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Language Terminology&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
Briefly on some terminology when working with the language:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Module&lt;/span&gt;:&amp;nbsp;Used to hold code&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Variable&lt;/span&gt;:&amp;nbsp;A named memory location of a specific data                                     type used to hold some value&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Procedure&lt;/span&gt;:&amp;nbsp;A callable series of &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;statements&lt;/span&gt; which may                                     or may not return a value&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Sub-Procedure&lt;/span&gt;:&amp;nbsp;A procedure with no return value&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Function&lt;/span&gt;:&amp;nbsp;A procedure with return value&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Methods&lt;/span&gt;: A procedure built into the class&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Constructor&lt;/span&gt;: Special method used to initialize and customize                                     the object. It has the same name as the class                                     &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Class&lt;/span&gt;: An OOP class which contains data and code&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Object&lt;/span&gt;: An instance of a class&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Arrays&lt;/span&gt;: Programming constructs that lets us access data                                     by numeric index&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Attributes&lt;/span&gt;: They are the items that specify information                                     about other items being used in VB. NET</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/5960020686766340350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/data-type-conversion-file-extensions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/5960020686766340350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/5960020686766340350'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/data-type-conversion-file-extensions.html' title='Data Type Conversion, File Extensions'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-3950180573895884624</id><published>2011-07-20T09:50:00.001-07:00</published><updated>2011-07-20T09:50:27.975-07:00</updated><title type='text'>Loops</title><content type='html'>&lt;u&gt;&lt;strong&gt;For Loop&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The For loop is the most popular loop. For loops enable us to execute a series of                                     expressions multiple numbers of times. The For loop in VB .NET needs a &lt;span style=&quot;color: blue;&quot;&gt;loop                                     index&lt;/span&gt; which counts the number of loop iterations as the loop executes. The                                     syntax for the For loop looks like this:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;For index=start to end[Step step]&lt;br /&gt;
[statements]&lt;br /&gt;
[Exit For]&lt;br /&gt;
[statements]&lt;br /&gt;
Next[index]&lt;/span&gt;                                 &lt;br /&gt;
The index variable is set to start automatically when the loop starts. Each time in                                     the loop, index is incremented by &lt;span style=&quot;color: blue;&quot;&gt;step&lt;/span&gt; and when index equals                                     end, the loop ends.                                 &lt;br /&gt;
&lt;u&gt;Example on For loop &lt;/u&gt;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;For Loop&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim d As Integer&lt;br /&gt;
For d = 0 To 2&lt;br /&gt;
System.Console.WriteLine(&quot;In the For Loop&quot;)&lt;br /&gt;
Next d&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/forloop.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;While loop &lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
While loop keeps executing until the condition against which it tests remain true.                                     The syntax of while loop looks like this:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;While condition&lt;br /&gt;
[statements]&lt;br /&gt;
End While&lt;/span&gt;                                 &lt;br /&gt;
&lt;u&gt;Example on While loop&lt;/u&gt;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;While Loop&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim d, e As Integer&lt;br /&gt;
d = 0&lt;br /&gt;
e = 6&lt;br /&gt;
While e &amp;gt; 4&lt;br /&gt;
e -= 1&lt;br /&gt;
d += 1&lt;br /&gt;
End While&lt;br /&gt;
System.Console.WriteLine(&quot;The Loop ran &quot; &amp;amp; e &amp;amp; &quot;times&quot;)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.                                     &lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/while.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Do Loop &lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The Do loop can be used to execute a fixed block of statements indefinite number of                                     times. The Do loop keeps executing it&#39;s statements while or until the condition is                                     true. Two keywords, &lt;span style=&quot;color: blue;&quot;&gt;while&lt;/span&gt; and &lt;span style=&quot;color: blue;&quot;&gt;until&lt;/span&gt; can                                     be used with the do loop. The Do loop also supports an &lt;span style=&quot;color: blue;&quot;&gt;Exit Do&lt;/span&gt; statement                                     which makes the loop to exit at any moment. The syntax of Do loop looks like this:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Do[{while | Until} condition]&lt;br /&gt;
[statements]&lt;br /&gt;
[Exit Do]&lt;br /&gt;
[statements]&lt;br /&gt;
Loop&lt;/span&gt;                                 &lt;br /&gt;
&lt;u&gt;Example on Do loop &lt;/u&gt;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table4&quot; title=&quot;Do Loop&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim str As String&lt;br /&gt;
Do Until str = &quot;Cool&quot;&lt;br /&gt;
System.Console.WriteLine(&quot;What to do?&quot;)&lt;br /&gt;
str = System.Console.ReadLine()&lt;br /&gt;
Loop&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.                                     &lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/doloop.gif&quot; /&gt;&amp;nbsp;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/3950180573895884624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/loops.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/3950180573895884624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/3950180573895884624'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/loops.html' title='Loops'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-6197575275712268956</id><published>2011-07-20T09:49:00.000-07:00</published><updated>2011-07-20T09:49:31.422-07:00</updated><title type='text'>Conditional Statements</title><content type='html'>&lt;strong&gt;&lt;u&gt;If....Else &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;statement&lt;/span&gt; &lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;If &lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;conditional&lt;/span&gt; expression is one of the most useful control                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;structures&lt;/span&gt; which allows us to execute a expression if a condition is true and execute                                     a different expression if it is False. The syntax looks like this:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;If condition Then&lt;br /&gt;
[&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;statements&lt;/span&gt;]&lt;br /&gt;
Else If condition Then&lt;br /&gt;
[statements]&lt;br /&gt;
-&lt;br /&gt;
-&lt;br /&gt;
Else&lt;br /&gt;
[statements]&lt;br /&gt;
End If&lt;/span&gt;                                 &lt;br /&gt;
&lt;u&gt;Understanding the Syntax&lt;/u&gt;                                     &lt;br /&gt;
&lt;br /&gt;
If &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;the condition&lt;/span&gt; is true, the statements following the &lt;span style=&quot;color: blue;&quot;&gt;Then&lt;/span&gt; keyword                                     will be executed, else, the statements following the ElseIf will be checked and if                                     true, will be executed, else, the statements in the else part will be executed.                                 &lt;br /&gt;
Example                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;If.... Then...Else statement&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;Imports&lt;/span&gt; System.&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;Console&lt;/span&gt;&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim i As &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;Integer&lt;/span&gt;&lt;br /&gt;
WriteLine(&quot;Enter an integer, 1 or 2 or 3&quot;)&lt;br /&gt;
i = Val(ReadLine())&lt;br /&gt;
&#39;ReadLine() method is used to read from console&lt;br /&gt;
&lt;br /&gt;
If i = 1 Then&lt;br /&gt;
WriteLine(&quot;One&quot;)&lt;br /&gt;
ElseIf i = 2 Then&lt;br /&gt;
WriteLine(&quot;Two&quot;)&lt;br /&gt;
ElseIf i = 3 Then&lt;br /&gt;
WriteLine(&quot;Three&quot;)&lt;br /&gt;
Else&lt;br /&gt;
WriteLine(&quot;Number not 1,2,3&quot;)&lt;br /&gt;
End If&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/if.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Select....Case Statement &lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
The &lt;span style=&quot;color: blue;&quot;&gt;Select Case&lt;/span&gt; statement executes one of several groups                                     of statements depending on the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;value of&lt;/span&gt; an expression. If your code has the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;capability&lt;/span&gt;                                     to handle different values of a particular variable then you can use a Select Case                                     statement. You use Select Case to test an expression, determine which of the given                                     cases it matches and execute the code in that matched case.                                 &lt;br /&gt;
The syntax of the Select Case statement looks like this:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Select Case testexpression&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [Case expressionlist-n&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [statements-n]] . . .&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [Case Else elsestatements]&lt;br /&gt;
End Select&lt;/span&gt;                                 &lt;br /&gt;
Example                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Select...Case Statement&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim keyIn As Integer&lt;br /&gt;
WriteLine(&quot;Enter a number between 1 and 4&quot;)                                                 &lt;br /&gt;
keyIn = Val(ReadLine())&lt;br /&gt;
&lt;br /&gt;
Select Case keyIn&lt;br /&gt;
Case 1&lt;br /&gt;
WriteLine(&quot;You entered 1&quot;)&lt;br /&gt;
Case 2&lt;br /&gt;
WriteLine(&quot;You entered 2&quot;)&lt;br /&gt;
Case 3&lt;br /&gt;
WriteLine(&quot;You entered 3&quot;)&lt;br /&gt;
Case 4&lt;br /&gt;
WriteLine(&quot;You entered 4&quot;)&lt;br /&gt;
End Select&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/select.gif&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/6197575275712268956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/conditional-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6197575275712268956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6197575275712268956'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/conditional-statements.html' title='Conditional Statements'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-233932828735393181</id><published>2011-07-20T09:48:00.000-07:00</published><updated>2011-07-20T09:48:04.981-07:00</updated><title type='text'>Methods</title><content type='html'>A Method is a procedure built into the class.&amp;nbsp;They are a series of statements                                     that are executed when called. Methods&amp;nbsp;allow us to handle&amp;nbsp;code in a simple                                     and organized fashion. There are two types of methods in VB .NET: those that return                                     a value (Functions) and those that do not return a value (Sub Procedures). Both&amp;nbsp;of                                     them&amp;nbsp;are discussed below.                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Sub Procedures&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Sub procedures&lt;/span&gt; are&amp;nbsp;methods&amp;nbsp;which do not return                                     a value. Each time when the Sub procedure is called the statements within it are executed                                     until the matching End Sub is encountered.&amp;nbsp;Sub Main(),&amp;nbsp;the starting point                                     of the program itself is a sub procedure. When the application starts execution,&amp;nbsp;control                                     is transferred to &lt;span style=&quot;color: blue;&quot;&gt;Main&lt;/span&gt; Sub procedure automatically which                                     is called by default.                                 &lt;br /&gt;
&lt;u&gt;Example of a Sub Procedure&lt;em&gt; &lt;/em&gt;&lt;/u&gt;                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Sub Procedures&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
&#39;sub procedure Main() is called by default&lt;br /&gt;
Display()&lt;br /&gt;
&#39;sub procedure display() which we are creating&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Sub Display()&lt;br /&gt;
System.Console.WriteLine(&quot;Using Sub Procedures&quot;)&lt;br /&gt;
&#39;executing sub procedure Display()&lt;br /&gt;
End Sub&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/sub.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Functions &lt;/u&gt;&lt;/strong&gt;&lt;a href=&quot;&quot; name=&quot;#fun&quot;&gt;&lt;/a&gt;                                 &lt;br /&gt;
Function is a method which returns a value. Functions are used to evaluate data, make                                     calculations or to transform data. Declaring a Function is similar to declaring a                                     Sub procedure.&amp;nbsp;Functions are declared with the &lt;span style=&quot;color: blue;&quot;&gt;Function&lt;/span&gt; keyword.                                     The following code is an example on Functions:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Functions&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                        Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Write(&quot;Sum is&quot; &amp;amp; &quot; &quot; &amp;amp; Add())&lt;br /&gt;
&#39;calling the function&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Public Function Add() As Integer&lt;br /&gt;
&#39;declaring a function add&lt;br /&gt;
Dim i, j As Integer&lt;br /&gt;
&#39;declaring two integers and assigning values to them&lt;br /&gt;
i = 10&lt;br /&gt;
j = 20&lt;br /&gt;
Return (i + j)&lt;br /&gt;
&#39;performing the sum of two integers and returning it&#39;s value&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The image below displays output from above code.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/language/images/function.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Calling Methods&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
A method is not executed until it is called. A method is called by referencing it&#39;s                                     name along with any required parameters. For example, the above code called&amp;nbsp;the                                     Add&amp;nbsp;method in Sub main like this:&lt;br /&gt;
&lt;strong&gt;Write(&quot;Sum is&quot; &amp;amp; &quot; &quot; &amp;amp; Add())&lt;/strong&gt;.                                 &lt;br /&gt;
&lt;strong&gt;Method Variables&lt;/strong&gt;                                 &lt;br /&gt;
Variables declared within methods are called method variables. They have method scope                                     which means that once the method is executed they are destroyed and their memory is                                     reclaimed. For example, from the above code (Functions) the Add method declared two                                     integer variables i, j. Those two variables are accessible only within the method                                     and not from outside the method.                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Parameters&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
A parameter is an argument that is passed to the method by the method that calls it.                                     Parameters are enclosed in parentheses after the method name in the method declaration.                                     You must specify types for these parameters. The general form of a method with parameters                                     looks like this:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Public Function Add(ByVal x1 as Integer, ByVal y1 as Integer)&lt;br /&gt;
------------&lt;br /&gt;
Implementation&lt;br /&gt;
------------&lt;br /&gt;
End Function&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/233932828735393181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/methods.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/233932828735393181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/233932828735393181'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/methods.html' title='Methods'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-1060051121081628782</id><published>2011-07-20T09:46:00.001-07:00</published><updated>2011-07-20T09:46:55.708-07:00</updated><title type='text'>Statements and Scope</title><content type='html'>&lt;u&gt;&lt;strong&gt;Statements &lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
A statement is a complete instruction. It can contain keywords, operators, variables,                                     literals, expressions and constants. Each statement &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;in Visual Basic&lt;/span&gt; should be either                                     a &lt;span style=&quot;color: blue;&quot;&gt;declaration statement&lt;/span&gt; or a &lt;span style=&quot;color: blue;&quot;&gt;executable                                     statement&lt;/span&gt;. A declaration statement is a statement that can create a variable,                                     constant, &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;data type&lt;/span&gt;. They are the one&#39;s we generally use to declare our variables.                                     On &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;the other hand&lt;/span&gt;, executable &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;statements&lt;/span&gt; are the statements that perform an action.                                     They execute a series of statements. They can execute a function, method, loop, etc.                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Option Statement&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
The Option statement is used to set a number of options for the code to prevent syntax                                     and logical errors. This statement is normally the first line of the code. The Option                                     values in Visual Basic are as follows.                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Option Compare&lt;/span&gt;: You can set it&#39;s value to Text or Binary.                                     This specifies if the strings are compared using binary or text comparison operators.&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Option Explicit&lt;/span&gt;: Default is On. You can set it to Off as                                     well. This requires to declare all the variables before they are used.&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Option Strict&lt;/span&gt;: Default is Off. You can set it&amp;nbsp;to On                                     as well. Used normally when working with conversions in code. If you want to assign                                     a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;value of&lt;/span&gt; one type to another then you should set it to On and use the conversion                                     functions else Visual Basic will consider that as an error.                                 &lt;br /&gt;
&lt;u&gt;Example of Option Statement &lt;/u&gt;                                 &lt;br /&gt;
The following code demonstrates&amp;nbsp;where to place the Option statement.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Option Statement&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Option &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;Strict&lt;/span&gt; Off&lt;br /&gt;
Imports System&lt;br /&gt;
Module Module 1&lt;br /&gt;
&lt;br /&gt;
Sub Main ()&lt;br /&gt;
Console.WriteLine (“Using Option”)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The following code throws an error because Option Strict is On and the code attempts                                     to convert a value of&amp;nbsp;type double to &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;integer&lt;/span&gt;.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table5&quot; title=&quot;Option Strict On&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Option Strict On&lt;br /&gt;
Imports System.Console&lt;br /&gt;
Module Module2&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim i As Integer&lt;br /&gt;
Dim d As Double = 20.12&lt;br /&gt;
i = d&lt;br /&gt;
WriteLine(i)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
We always should program with Option Strict On. Doing so allows us to catch many errors                                     at compile time that would otherwise be &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;difficult&lt;/span&gt; to track at run time.                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Imports Statement &lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
The Imports statement is used to import namespaces. Using this statement prevents                                     you to list the entire namespace when you refer to them.                                 &lt;br /&gt;
&lt;u&gt;Example of Imports Statement &lt;/u&gt;                                 &lt;br /&gt;
The following code imports the namespace &lt;span style=&quot;color: blue;&quot;&gt;System.Console&lt;/span&gt; and                                     uses the methods of that namespace&amp;nbsp;preventing us to refer to it every time we                                     need a method of this namespace.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Imports Statement&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Write(&quot;Imports Statement&quot;)&lt;br /&gt;
WriteLine(&quot;Using Import&quot;)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The above two methods&amp;nbsp;without an  imports statement would look like this: System.Console.Write(&quot;Imports                                     Statement&quot;) and&amp;nbsp;  System.Console.WriteLine(&quot;Using Import&quot;)                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;With Statement&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
With statemnt is used to execute statements using a particular object. The syntax                                     looks like this:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;With object&lt;br /&gt;
[statements]&lt;br /&gt;
End With&lt;/span&gt;                                 &lt;br /&gt;
&lt;u&gt;Sample Code&lt;/u&gt;                                 &lt;br /&gt;
The following code sets text and width for a button using the With Statement.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table6&quot; title=&quot;With Statement&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)_&lt;br /&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;Handles&lt;/span&gt; MyBase.Load&lt;br /&gt;
With Button1&lt;br /&gt;
.Text = &quot;With Statement&quot;&lt;br /&gt;
.Width = 150&lt;br /&gt;
End With&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Boxing &lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
Boxing is&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;implicit conversion&lt;/span&gt; of value types to reference                                     types. Recall that all classes and types are derived from the Object class. Because                                     they are derived from Object class they can be implicitly converted to that type.                                     The following sample shows that:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table4&quot; title=&quot;Boxing&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Dim x as Integer=20&lt;br /&gt;
&#39;declaring an integer x&lt;br /&gt;
Dim o as Object&lt;br /&gt;
&#39;declaring an object&lt;br /&gt;
o=x&lt;br /&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;converting&lt;/span&gt; integer to object                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Unboxing is the conversion of a boxed value back to a value type.                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Scope&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The&amp;nbsp; scope of an element in code is all the code that can refer to it without                                     qualifying it&#39;s name. Stated other way, an element&#39;s scope is it&#39;s accessibility in                                     code. Scope is normally used when writing large programs as large programs divide&amp;nbsp;code                                     into different classes, modules, etc. Also, scope prevents the chance of code referring                                     to the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;wrong&lt;/span&gt; item. The different &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;kinds of&lt;/span&gt; scope available in VB .NET are as follows:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Block Scope&lt;/span&gt;: The element declared is available only within                                     the code block in which it is declared.&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Procedure Scope&lt;/span&gt;: The element declared is available only                                     within the procedure in which it is declared.&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Module Scope&lt;/span&gt;: The element is available to all code within                                     the module and class in which it is declared.&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Namespace Scope&lt;/span&gt;: The element declared is available to all                                     code in the namespace.</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/1060051121081628782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/statements-and-scope.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/1060051121081628782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/1060051121081628782'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/statements-and-scope.html' title='Statements and Scope'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-6533326400693005063</id><published>2011-07-20T09:45:00.001-07:00</published><updated>2011-07-20T09:45:38.969-07:00</updated><title type='text'>Data Types, Access Specifiers</title><content type='html'>&lt;u&gt;&lt;strong&gt;Data Types in VB .NET&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
The Data types available in VB .NET,&amp;nbsp;their size, type, description are summarized                                     in the table below.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;4&quot; id=&quot;Table1&quot; title=&quot;Data Types&quot;&gt;&lt;tbody&gt;
&lt;tr bgcolor=&quot;Maroon&quot;&gt;   &lt;td width=&quot;20%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Data Type&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;20%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Size in Bytes&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td width=&quot;30%&quot;&gt;&lt;span style=&quot;color: white; font-family: Verdana; font-size: xx-small;&quot;&gt;&lt;b&gt;Type&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Byte&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;8-bit unsigned integer&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Byte&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Char&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;16-bit Unicode characters&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Char&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Integer&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;32-bit signed integer&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Int32&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Double&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;8&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;64-bit floating point variable&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Double&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Long&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;8&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;64-bit signed integer&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Int64&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Short&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;16-bit signed integer&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Int16&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Single&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;32-bit floating point variable&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Single&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;String&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Varies&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Non-Numeric Type&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.String&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Date&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;8&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Date&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Boolean&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Non-Numeric Type&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Boolean&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Object&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Non-Numeric Type&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Object&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Decimal&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;16&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;128-bit floating point variable&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;System.Decimal&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Access Specifiers&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
Access specifiers let&#39;s us specify how a variable, method or a class can be used.                                     The following are the most commonly used one&#39;s:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Public&lt;/span&gt;: Gives variable public access which means that there                                     is no restriction on their accessibility&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Private&lt;/span&gt;: Gives variable private access which means that                                     they are accessible only within their declaration content&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Protected&lt;/span&gt;: Protected access gives a variable accessibility                                     within their own class or a class derived from that class&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Friend&lt;/span&gt;: Gives variable friend access which means that they                                     are accessible within the program that contains their declaration&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Protected Friend&lt;/span&gt;: Gives a variable both protected and friend                                     access&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Static&lt;/span&gt;: Makes a variable static which means that the variable                                     will hold the value even the procedure in which they are declared ends&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Shared&lt;/span&gt;: Declares a variable that can be shared across many                                     instances and which is not associated with a specific instance of a class or structure&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;ReadOnly&lt;/span&gt;: Makes a variable only to be read and cannot be                                     written                                 &lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Variables&lt;/strong&gt;&lt;/u&gt;                                 &lt;br /&gt;
Variables are used to store data. A variable has a name to which we refer and the                                     data type, the type of data the variable holds. VB .NET now needs variables to be                                     declared before using them. Variables are declared with the &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; keyword.                                     Dim stands for Dimension.                                 &lt;br /&gt;
Example                                 &lt;br /&gt;
&lt;span&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim a,b,c as Integer&lt;br /&gt;
&#39;declaring three variables of type integer&lt;br /&gt;
a=10&lt;br /&gt;
b=20&lt;br /&gt;
c=a+b&lt;br /&gt;
Write(&quot;Sum of a and b is&quot; &amp;amp; c)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/6533326400693005063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/data-types-access-specifiers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6533326400693005063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6533326400693005063'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/data-types-access-specifiers.html' title='Data Types, Access Specifiers'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-6114012338843726895</id><published>2011-07-20T09:44:00.001-07:00</published><updated>2011-07-20T09:44:45.169-07:00</updated><title type='text'>Console Applications</title><content type='html'>Console Applications are &lt;span style=&quot;color: blue;&quot;&gt;command-line oriented&lt;/span&gt; applications                                     that allow us to read characters from the console, write characters to the console                                     and are executed in the DOS version. Console Applications are written in code and                                     are supported by the &lt;span style=&quot;color: blue;&quot;&gt;System.Console&lt;/span&gt; &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;namespace&lt;/span&gt;.                                 &lt;br /&gt;
&lt;strong&gt;Example on a Console Application&lt;/strong&gt;                                 &lt;br /&gt;
Create a folder in C: drive with any name (say, examples) and make sure the console                                     applications which you open are saved there. That&#39;s for your convenience. The default                                     location where all the .NET applications are saved is &lt;span style=&quot;color: blue;&quot;&gt;C:\Documents                                     and Settings\Administrator\&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;My Documents&lt;/span&gt;\Visual Studio Projects&lt;/span&gt;. The new project                                     dialogue looks like the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;New Project Dialogue&quot; src=&quot;http://www.startvbdotnet.com/language/images/console.gif&quot; /&gt;                                 &lt;br /&gt;
The following code is example of a console application:                                     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table1&quot; title=&quot;Code&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
System.Console.Write(&quot;Welcome to Console Applications&quot;)&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
You run the&amp;nbsp;code by selecting &lt;span style=&quot;color: blue;&quot;&gt;Debug-&amp;gt;Start&lt;/span&gt; from                                     the main menu or by pressing &lt;span style=&quot;color: blue;&quot;&gt;F5&lt;/span&gt; on &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;the keyboard&lt;/span&gt;. The result&amp;nbsp;&quot;Welcome                                     to Console Applications&quot;&amp;nbsp; displayed on a DOS window. Alternatively, you can run                                     the program using the VB compiler (vbc). To do that, go to the Visual Studio. NET                                     command prompt selecting from                                     &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Start-&amp;gt;Programs-&amp;gt;Visual Studio.NET-&amp;gt;Visual Studio.NET                                     Tools-&amp;gt;Visual Studio.NET Command Prompt&lt;/span&gt; and&amp;nbsp;type:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;c:\examples&amp;gt;vbc example1.vb&lt;/span&gt;.                                 &lt;br /&gt;
The result, &quot;Welcome to Console Applications&quot; is displayed on a DOS window as shown                                     in the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Console Application&quot; src=&quot;http://www.startvbdotnet.com/language/images/console1.gif&quot; /&gt;                                 &lt;br /&gt;
&lt;strong&gt;Breaking the Code to understand it&lt;/strong&gt;                                 &lt;br /&gt;
Note the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;first&lt;/span&gt; line, we&#39;re creating a Visual Basic Module and Modules are designed                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;to hold&lt;/span&gt; code. All the code which we write should be within the Module.&lt;br /&gt;
Next line starts with Sub Main(),&amp;nbsp;the entry point of the program.&lt;br /&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;The third&lt;/span&gt; line indicates that we are using the Write method &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;of the System&lt;/span&gt;.Console                                     class to write to the console.                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Commenting the Code&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
Comments in VB.NET begin with a &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;single&lt;/span&gt; quote (&#39;) character and the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;statements&lt;/span&gt; following                                     that are ignored by the compiler. Comments are generally used to &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;specify&lt;/span&gt; what is going                                     on in the program and also gives an idea about the flow of the program. The general                                     form looks like this:                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Dim&amp;nbsp;I as &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;Integer&lt;/span&gt;&lt;br /&gt;
&#39;declaring an integer&lt;br /&gt;
&lt;br /&gt;
Code&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/6114012338843726895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/console-applications.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6114012338843726895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6114012338843726895'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/console-applications.html' title='Console Applications'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-2104977727962084689</id><published>2011-07-20T09:43:00.000-07:00</published><updated>2011-07-20T09:43:30.928-07:00</updated><title type='text'>VB Language</title><content type='html'>Visual Basic, the name&amp;nbsp;makes me feel that it is something special. In the History                                     of Computing world no other product sold more copies than Visual Basic did. Such is                                     the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;importance of&lt;/span&gt; that language which clearly states how widely it is used for developing                                     applications. Visual Basic is very popular for it&#39;s friendly working (graphical) &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;environment&lt;/span&gt;.                                     Visual Basic. NET is an extension of &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;Visual Basic programming&lt;/span&gt; language with many new                                     features in it. The changes from VB to VB .NET are huge, ranging from the change in                                     syntax of the language to the types of projects we can create now and the way we design                                     applications. Visual Basic .NET was designed to take advantage of the .&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;NET Framework&lt;/span&gt;                                     base classes and runtime environment. It comes with power packed features that simplify                                     application development.                                                                                                       &lt;strong&gt;Briefly on some&amp;nbsp;changes: &lt;/strong&gt;                                 &lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;The biggest change from VB to VB .NET is, VB                                     .NET is Object-Oriented now.&amp;nbsp;VB .NET now supports all the key OOP features like                                     Inheritance, Polymorphism, Abstraction and Encapsulation. We can now create&amp;nbsp;                                     classes and objects, derive classes from other classes and so on. The major advantage                                     of OOP is code reusability&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;The Command Button now is&amp;nbsp;Button and the                                     TextBox is TextBox instead of Text as&amp;nbsp;in VB6&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;Many new controls have been &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;added&lt;/span&gt; to the toolbar                                     to make application development more efficient&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;VB .NET now adds Console Applications to it                                     apart from Windows and Web Applications. Console applications are console oriented                                     applications that run in the DOS version&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;All the built-in VB functionality now is encapsulated                                     in a Namespace (collection of different classes) called System&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;New keywords are added and old one&#39;s are either                                     removed or renamed&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;VB .NET is strongly typed which means that we                                     need to declare all the variables by default before using them&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;VB .NET now supports structured exception handling                                     using Try...Catch...Finally syntax&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;The syntax for &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;procedures&lt;/span&gt; is changed. Get and                                     Let are replaced by Get and Set&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;Event handling procedures are now passed only                                     two parameters&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;The way we handle data with databases is changed                                     as well. VB .NET now uses ADO .NET, a new data handling model to communicate with                                     databases on local machines or on a network and also it makes handling of data on                                     the Internet easy. All the data in ADO .NET is represented in XML format and is exchanged                                     in the same format. &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;Representing&lt;/span&gt; data in XML format allows us for sending large amounts                                     of data on the Internet and it also reduces network traffic when communicating with                                     the database&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;VB .NET now supports Multithreading. A threaded                                     application allows to do number of different things at once, running different execution                                     threads allowing to use system resources&lt;br /&gt;
&lt;img align=&quot;middle&quot; src=&quot;http://www.startvbdotnet.com/language/arrow.gif&quot; /&gt;Web Development is now an integral part of VB                                     .NET making Web Forms and Web Services two major types of applications                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Namespaces &lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
A namespace is a collection of &lt;span style=&quot;color: blue;&quot;&gt;different classes&lt;/span&gt;. All VB                                     applications are developed using classes from the .NET System namespace. The namespace                                     with all the built-in VB functionality is the &lt;span style=&quot;color: blue;&quot;&gt;System &lt;/span&gt;namespace.                                     All other namespaces are based on this System namespace.                                 &lt;br /&gt;
&lt;u&gt;Some&amp;nbsp;Namespaces and their use:&lt;/u&gt;                                 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System&lt;/span&gt;: Includes essential classes and base classes for                                     commonly used &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;data types&lt;/span&gt;, events, exceptions and so on&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Collections&lt;/span&gt;: Includes classes and interfaces that                                     define various collection of objects such as list, queues,                                     &lt;br /&gt;
hash tables, arrays, etc&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Data&lt;/span&gt;: Includes classes which lets us handle data                                     from data sources&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Data.&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;OleDb&lt;/span&gt;&lt;/span&gt;: Includes classes that support the OLEDB                                     .NET provider&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Data.SqlClient&lt;/span&gt;: Includes classes that support the                                     SQL Server .NET provider&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Diagnostics&lt;/span&gt;: Includes classes that allow to debug                                     our application and to step through our code&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Drawing&lt;/span&gt;: Provides access to drawing methods&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Globalization&lt;/span&gt;: Includes classes that specify culture-related                                     information&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.IO&lt;/span&gt;: Includes classes for data access with Files&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Net&lt;/span&gt;: Provides interface to protocols used on the                                     internet&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Reflection&lt;/span&gt;: Includes classes and interfaces that                                     return information about types, methods and fields&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Security&lt;/span&gt;: Includes classes to support the structure                                     of common language runtime security system&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Threading&lt;/span&gt;: Includes classes and interfaces to support                                     multithreaded applications&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Web&lt;/span&gt;: Includes classes and interfaces that support                                     browser-server communication&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Web.Services&lt;/span&gt;: Includes classes that let us build                                     and use Web Services&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.Windows.Forms&lt;/span&gt;: Includes classes for creating Windows                                     based forms&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;System.XML&lt;/span&gt;: Includes classes for XML support                                 &lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Assemblies&lt;/u&gt;&lt;/strong&gt;                                 &lt;br /&gt;
An assembly is the &lt;span style=&quot;color: blue;&quot;&gt;building block&lt;/span&gt; of a&amp;nbsp;.NET application.                                     It is a self describing collection of code, resources, and metadata (data about data,                                     example, name, size, version of a file is metadata about that file). An Assembly is                                     a complied and versioned collection of code and metadata that forms an atomic functional                                     unit. Assemblies take the form of a&amp;nbsp; dynamic link library (.dll) file or executable                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;program file&lt;/span&gt; (.exe) but they differ as they contain the information found in a type                                     library and the information about everything else needed to use &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;an application&lt;/span&gt; or                                     component. All&amp;nbsp;.NET programs are constructed from these Assemblies. Assemblies                                     are made of two parts:&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;manifest&lt;/span&gt;, contains information                                     about what is contained within &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;the assembly&lt;/span&gt; and&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;modules&lt;/span&gt;,&amp;nbsp;internal                                     files of &lt;span style=&quot;color: blue;&quot;&gt;IL&lt;/span&gt; code which are ready to run. When programming,                                     we don&#39;t directly deal with assemblies as the CLR and the .NET framework takes care                                     of that behind the scenes. The assembly file is visible in the Solution Explorer window                                     of the project.                                 &lt;br /&gt;
An assembly includes:                                 &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;                                         Information for each public class or type used in the assembly – information includes                                         class or type names, the classes&amp;nbsp;from which an individual class is derived, etc&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;                                         Information on all public methods in each class, like, the method name and return                                         values (if any)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;                                         Information on every public parameter for each method like the parameter&#39;s name and                                         type&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;                                         Information on public enumerations including names and values&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;                                         Information on the assembly version (each assembly has a specific version number)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;                                         Intermediate language code to execute                                         &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;                                         A list of types exposed by the assembly and list of other assemblies&amp;nbsp;required                                         by the assembly&amp;nbsp;                                     &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Image of a Assembly file is displayed below.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;VB .NET Assembly file&quot; src=&quot;http://www.startvbdotnet.com/language/images/assembly.gif&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/2104977727962084689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/vb-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/2104977727962084689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/2104977727962084689'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/vb-language.html' title='VB Language'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-2804679650931258057</id><published>2011-07-15T09:12:00.001-07:00</published><updated>2011-07-15T09:12:37.857-07:00</updated><title type='text'>Structures</title><content type='html'>Structures can be defined as a tool for handling a group of logically related &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot;&gt;data                                     items&lt;/span&gt;. They are user-defined and provide a method for packing together data of different                                     types. Structures are very similar to Classes. Like Classes, they too can contain                                     members such as fields and methods. The main difference between classes and structures                                     is, classes are &lt;span style=&quot;color: blue;&quot;&gt;reference&lt;/span&gt; types and structures are &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt; types.                                     In practical &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;terms&lt;/span&gt;, structures are used for smaller &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;lightweight&lt;/span&gt; objects that do not                                     persist for long and classes are used for &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;larger&lt;/span&gt; objects that are expected to exist                                     in memory for long periods. We declare a structure in &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;Visual Basic&lt;/span&gt; .NET with the &lt;span style=&quot;color: blue;&quot;&gt;Structure&lt;/span&gt; keyword.                                 &lt;br /&gt;
&lt;strong&gt;Value Types and Reference Types&lt;/strong&gt;                                 &lt;br /&gt;
Value Types and Reference Types belong to Application data memory and the difference                                     between them is the way variable data is accessed. We will have a brief overview about                                     them.                                 &lt;br /&gt;
&lt;strong&gt;Value Types&lt;/strong&gt;                                 &lt;br /&gt;
In VB .NET we use the Dim &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;statement&lt;/span&gt; to create a variable that represents a value type.                                     For example, we declare a integer variable with the following statement: &lt;strong&gt;Dim                                     x as Integer&lt;/strong&gt;. The statement tells the run time to allocate the appropriate                                     amount of memory to hold an integer variable. The statement creates a variable but                                     does not assign a value to it. We assign a value to that variable like this: &lt;strong&gt;x=55&lt;/strong&gt;.                                     When a variable of value type goes &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;out of&lt;/span&gt; scope, it is destroyed and it&#39;s memory is                                     reclaimed.                                 &lt;br /&gt;
&lt;strong&gt;Reference Types&lt;/strong&gt;                                 &lt;br /&gt;
Creating a variable of reference type is a two-step process, declare and instantiate.                                     The first step is to declare a variable as that type. For example, the following statement &lt;strong&gt;Dim                                     Form1 as new System.Windows.&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;Forms&lt;/span&gt;.Form&lt;/strong&gt; tells the run time to set enough memory                                     to hold a Form variable. The second step, instantiation, creates the object. It looks                                     like this in code: &lt;strong&gt;Form1=New System.Windows.Forms.Form&lt;/strong&gt;. A variable                                     of reference type exists in two memory locations and that&#39;s why when that variable                                     goes out of scope, the reference to that object is destroyed but the object itself                                     is not destroyed. If any other references to that object exist, the object remains                                     intact. If no references exist to that object then it is &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;subject to&lt;/span&gt; &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;garbage collection&lt;/span&gt;.                                 &lt;br /&gt;
&lt;strong&gt;Code for Creating a Structure&lt;/strong&gt;                                 &lt;br /&gt;
The following code creates a Structure named Employee with five fields of different                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;data types&lt;/span&gt;.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table2&quot; title=&quot;Structures&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                                 Module Module1&lt;br /&gt;
&lt;br /&gt;
Structure Employee&lt;br /&gt;
&#39;declaring a structure named Employee&lt;br /&gt;
Dim EmpName As String&lt;br /&gt;
Dim EmpDesignation As String&lt;br /&gt;
Dim EmpCity As String&lt;br /&gt;
Dim EmpSal As Double&lt;br /&gt;
Dim EmpId As Integer&lt;br /&gt;
&#39;declaring five fields of different data types in the structure&lt;br /&gt;
End Structure&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim san As New Employee()&lt;br /&gt;
&#39;creating an instance of Employee&lt;br /&gt;
san.EmpName = &quot;Sandeep&quot;&lt;br /&gt;
san.EmpDesignation = &quot;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;Software&lt;/span&gt; Developer&quot;&lt;br /&gt;
san.EmpCity = &quot;Sydney&quot;&lt;br /&gt;
san.EmpSal = 60000&lt;br /&gt;
san.EmpId = 2707&lt;br /&gt;
&#39;assigning values to member variables&lt;br /&gt;
WriteLine(&quot;EmpName&quot; + &quot; &quot; + san.EmpName)&lt;br /&gt;
WriteLine(&quot;EmpDesignation&quot; + &quot; &quot; + san.EmpDesignation)&lt;br /&gt;
WriteLine(&quot;EmpCity&quot; + &quot; &quot; + san.EmpCity)&lt;br /&gt;
WriteLine(&quot;EmpSalary&quot; + &quot; &quot; + san.EmpSal.ToString)&lt;br /&gt;
WriteLine(&quot;EmpID&quot; + &quot; &quot; + san.EmpId.ToString)&lt;br /&gt;
&#39;accessing member variables with the period/dot operator&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The output of above code is the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/oop/images/struct.gif&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/2804679650931258057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/structures.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/2804679650931258057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/2804679650931258057'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/structures.html' title='Structures'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-6170531014553824759</id><published>2011-07-15T09:11:00.001-07:00</published><updated>2011-07-15T09:11:44.733-07:00</updated><title type='text'>Abstract Classes</title><content type='html'>An &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;abstract class&lt;/span&gt; is the one that is not used to create objects. An abstract class                                     is designed to act as a base class (to be inherited by other classes). Abstract class                                     is &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;a design&lt;/span&gt; concept in &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;program&lt;/span&gt; development and &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;provides&lt;/span&gt; a base upon which other classes                                     are built. &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;Abstract&lt;/span&gt; classes are similar to interfaces. After declaring an abstract                                     class, &lt;span style=&quot;color: blue;&quot;&gt;it cannot be instantiated on it&#39;s own&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;it                                     must be inherited&lt;/span&gt;. Like interfaces, abstract classes can specify members that                                     must be implemented in inheriting classes. Unlike interfaces, a class can inherit                                     only one abstract class. Abstract classes can only specify members that should be                                     implemented by all inheriting classes.                                 &lt;br /&gt;
&lt;strong&gt;Creating Abstract Classes&lt;/strong&gt;                                 &lt;br /&gt;
In &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;Visual Basic&lt;/span&gt; .NET we create an abstract class by using the &lt;span style=&quot;color: blue;&quot;&gt;MustInherit&lt;/span&gt; keyword.                                     An abstract class like all other classes can implement any number of members. Members                                     of an abstract class can either be Overridable (all the inheriting classes can create                                     their own implementation of the members) or they &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;can have&lt;/span&gt; a fixed implementation that                                     will be common to all inheriting members. Abstract classes can also specify abstract                                     members. Like abstract classes, abstract members also provide no details regarding                                     their implementation. Only the member type, access level, required parameters and                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;return&lt;/span&gt; type are specified. To declare an abstract member we use the &lt;span style=&quot;color: blue;&quot;&gt;MustOverride&lt;/span&gt; keyword.                                     Abstract members should be declared in abstract classes.                                 &lt;br /&gt;
&lt;strong&gt;Implementing Abstract Class&lt;/strong&gt;                                 &lt;br /&gt;
When a class inherits from an abstract class, it must implement every abstract member                                     defined by the abstract class. Implementation is possible by overriding the member                                     specified in the abstract class. The following code demonstrates the declaration and                                     implementation of an abstract class.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table2&quot; title=&quot;Abstract Class in VB&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                                 Module Module1&lt;br /&gt;
&lt;br /&gt;
Public MustInherit Class AbstractClass&lt;br /&gt;
&#39;declaring an abstract class with MustInherit keyword&lt;br /&gt;
Public MustOverride &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;Function&lt;/span&gt; Add() As &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;Integer&lt;/span&gt;&lt;br /&gt;
Public MustOverride Function Mul() As Integer&lt;br /&gt;
&#39;declaring two abstract members with MustOverride keyword&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class AbstractOne&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Inherits AbstractClass&lt;br /&gt;
&#39;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;implementing&lt;/span&gt; the abstract class by inheriting&lt;br /&gt;
Dim i As Integer = 20&lt;br /&gt;
Dim j As Integer = 30&lt;br /&gt;
&#39;declaring two integers&lt;br /&gt;
&lt;br /&gt;
Public Overrides Function Add() As Integer&lt;br /&gt;
Return i + j&lt;br /&gt;
End Function&lt;br /&gt;
&#39;implementing the add method&lt;br /&gt;
&lt;br /&gt;
Public Overrides Function Mul() As Integer&lt;br /&gt;
Return i * j&lt;br /&gt;
End Function&lt;br /&gt;
&#39;implementing the mul method&lt;br /&gt;
&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim abs As New AbstractOne()&lt;br /&gt;
&#39;creating an instance of AbstractOne&lt;br /&gt;
WriteLine(&quot;Sum is&quot; &amp;amp; &quot; &quot; &amp;amp; abs.Add())&lt;br /&gt;
WriteLine(&quot;Multiplication is&quot; &amp;amp; &quot; &quot; &amp;amp; abs.Mul())&lt;br /&gt;
&#39;displaying output&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
The output of above code is the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/oop/images/abs.gif&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/6170531014553824759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/abstract-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6170531014553824759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/6170531014553824759'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/abstract-classes.html' title='Abstract Classes'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-1778034298313249594</id><published>2011-07-15T09:10:00.001-07:00</published><updated>2011-07-15T09:10:46.364-07:00</updated><title type='text'>Interfaces</title><content type='html'>&lt;span style=&quot;color: blue;&quot;&gt;Interface&lt;/span&gt; &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;keyword&lt;/span&gt;                                     to create an interface and &lt;span style=&quot;color: blue;&quot;&gt;implements&lt;/span&gt; keyword to implement                                     the interface. Once you create an interface you need to implement all the methods                                     specified in that interface. The following code demonstrates the use of interface.&lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table2&quot; title=&quot;Interfaces in VB&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                         Imports System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim OneObj As New One()&lt;br /&gt;
Dim TwoObj As New Two()&lt;br /&gt;
&#39;creating objects of class One and Two&lt;br /&gt;
OneObj.disp()&lt;br /&gt;
OneObj.multiply()&lt;br /&gt;
TwoObj.disp()&lt;br /&gt;
TwoObj.multiply()&lt;br /&gt;
&#39;accessing the methods from classes as specified in the interface&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module&lt;br /&gt;
&lt;br /&gt;
Public Interface Test&lt;br /&gt;
&#39;creating an Interface named Test&lt;br /&gt;
Sub disp()&lt;br /&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;Function&lt;/span&gt; Multiply() As Double&lt;br /&gt;
&#39;specifying two methods in an interface&lt;br /&gt;
End Interface&lt;br /&gt;
&lt;br /&gt;
Public Class One&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;Implements&lt;/span&gt; Test&lt;br /&gt;
&#39;implementing interface in class One&lt;br /&gt;
&lt;br /&gt;
Public i As Double = 12&lt;br /&gt;
Public j As Double = 12.17&lt;br /&gt;
&lt;br /&gt;
Sub disp() Implements Test.disp&lt;br /&gt;
&#39;implementing the method specified in interface&lt;br /&gt;
WriteLine(&quot;sum of i+j is&quot; &amp;amp; i + j)&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Public Function multiply() As Double Implements Test.Multiply&lt;br /&gt;
&#39;implementing the method specified in interface&lt;br /&gt;
WriteLine(i * j)&lt;br /&gt;
Read()&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class Two&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Implements Test&lt;br /&gt;
&#39;implementing the interface in class Two&lt;br /&gt;
&lt;br /&gt;
Public a As Double = 20&lt;br /&gt;
Public b As Double = 32.17&lt;br /&gt;
&lt;br /&gt;
Sub disp() Implements Test.disp&lt;br /&gt;
WriteLine(&quot;Welcome to Interfaces&quot;)&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Public Function multiply() As Double Implements Test.Multiply&lt;br /&gt;
WriteLine(a * b)&lt;br /&gt;
Read()&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
End Class                                           &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Output of above code is the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;image&lt;/span&gt; below.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/oop/images/interface.gif&quot; /&gt;&amp;nbsp;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/1778034298313249594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/interfaces.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/1778034298313249594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/1778034298313249594'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/interfaces.html' title='Interfaces'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-4516410596492964454</id><published>2011-07-15T09:09:00.001-07:00</published><updated>2011-07-15T09:09:55.929-07:00</updated><title type='text'>Polymorphism</title><content type='html'>Polymorphism is one of the crucial features of OOP. It means&amp;nbsp; &quot;&lt;span style=&quot;color: blue;&quot;&gt;one                                     name&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;multiple forms&lt;/span&gt;&quot;. It is also called as &lt;span style=&quot;color: blue;&quot;&gt;Overloading&lt;/span&gt; which                                     means the use of same thing for different purposes. Using Polymorphism we can create&amp;nbsp;as                                     many functions&amp;nbsp;we want with one function name but with different argument list.                                     The function performs different operations based on the argument list in the function                                     call. The exact function to be invoked will be determined by checking the type and                                     number of arguments in the function.                                 &lt;br /&gt;
The following code demonstrates the implementation of Polymorphism.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table2&quot; title=&quot;Polymorphism in VB &quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                          Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim two As New One()&lt;br /&gt;
WriteLine(two.add(10))&lt;br /&gt;
&#39;calls the function with one argument&lt;br /&gt;
WriteLine(two.add(10, 20))&lt;br /&gt;
&#39;calls the function with two arguments&lt;br /&gt;
WriteLine(two.add(10, 20, 30))&lt;br /&gt;
&#39;calls the function with three arguments&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module&lt;br /&gt;
&lt;br /&gt;
Public Class One&lt;br /&gt;
Public i, j, k As Integer&lt;br /&gt;
&lt;br /&gt;
Public Function add(ByVal i As Integer) As Integer&lt;br /&gt;
&#39;function with one argument&lt;br /&gt;
Return i&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
Public Function add(ByVal i As Integer, ByVal j As Integer) As Integer&lt;br /&gt;
&#39;function with two arguments&lt;br /&gt;
Return i + j&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
Public Function add(ByVal i As Integer, ByVal j As Integer, ByVal k As Integer) As                                             Integer&lt;br /&gt;
&#39;function with three arguments&lt;br /&gt;
Return i + j + k&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
End Class                                          &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Output of the above code is shown in the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/oop/images/poly.gif&quot; /&gt;&amp;lt;=&quot;&quot; p=&quot;p&quot;&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/4516410596492964454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/polymorphism.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/4516410596492964454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/4516410596492964454'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/polymorphism.html' title='Polymorphism'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8749066621435995088.post-8397406025087579705</id><published>2011-07-15T09:08:00.001-07:00</published><updated>2011-07-15T09:08:55.470-07:00</updated><title type='text'>Inheritance</title><content type='html'>A key feature of OOP is reusability. It&#39;s always time saving and useful if we can                                     reuse something that already exists rather than trying to create the same thing again                                     and again. Reusing &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;the class&lt;/span&gt; that is tested, debugged and used many times can save                                     us time and effort of developing and testing it again. Once a class has been written                                     and tested, it can be used by other programs to suit the program&#39;s &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;requirement&lt;/span&gt;. This                                     is done by creating a new class from an existing class. The process of deriving a                                     new class from an existing class is called Inheritance. The old class is called the &lt;span style=&quot;color: blue;&quot;&gt;base                                     class&lt;/span&gt; and the new class is called &lt;span style=&quot;color: blue;&quot;&gt;derived class&lt;/span&gt;.                                     The &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot;&gt;derived&lt;/span&gt; class inherits some or everything of the base class. In &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;Visual Basic&lt;/span&gt; we                                     use the &lt;span style=&quot;color: blue;&quot;&gt;Inherits&lt;/span&gt; keyword to inherit one class from other.                                     &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;The general&lt;/span&gt; form of deriving a new class from an existing class looks as follows:                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table2&quot; title=&quot;Inheritance in VB&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                                 Public Class One&lt;br /&gt;
---&lt;br /&gt;
---&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class Two&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits One&lt;br /&gt;
---&lt;br /&gt;
---&lt;br /&gt;
End Class                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Using Inheritance we can use the variables, methods, properties, etc, from the base                                     class and add more &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot;&gt;functionality&lt;/span&gt; to it in the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;derived class&lt;/span&gt;. The following code demonstrates                                     the process of Inheritance in Visual Basic.                                 &lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;Linen&quot; border=&quot;0&quot; id=&quot;Table3&quot; title=&quot;Code to Inherit in VB&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td&gt;                                                 &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;Imports&lt;/span&gt; System.Console&lt;br /&gt;
Module Module1&lt;br /&gt;
&lt;br /&gt;
Sub Main()&lt;br /&gt;
Dim ss As New Two()&lt;br /&gt;
WriteLine(ss.sum())&lt;br /&gt;
Read()&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
End Module&lt;br /&gt;
&lt;br /&gt;
Public Class One&lt;br /&gt;
&#39;base class&lt;br /&gt;
Public i As Integer = 10&lt;br /&gt;
Public j As Integer = 20&lt;br /&gt;
&lt;br /&gt;
Public Function add() As Integer&lt;br /&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot;&gt;Return&lt;/span&gt; i + j&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class Two&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Inherits One&lt;br /&gt;
&#39;derived class. class two inherited from class one&lt;br /&gt;
Public k As Integer = 100&lt;br /&gt;
&lt;br /&gt;
Public Function sum() As Integer&lt;br /&gt;
&#39;using the variables, function from base class and &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;adding&lt;/span&gt; more functionality&lt;br /&gt;
Return i + j + k&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
End Class                                         &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Output of above code is sum of i, j, k as shown in the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://www.startvbdotnet.com/oop/images/inh.gif&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://startvbdotnet.blogspot.com/feeds/8397406025087579705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/inheritance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/8397406025087579705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8749066621435995088/posts/default/8397406025087579705'/><link rel='alternate' type='text/html' href='http://startvbdotnet.blogspot.com/2011/07/inheritance.html' title='Inheritance'/><author><name>Rab Nawaz</name><uri>http://www.blogger.com/profile/00566179666920714287</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>