Archive for the ‘Visual Basic’ Category

Add a Database

editVisual Basic / programmingcommentsNo Comments »
June 30th 2008

Chapter3_Prog1_001
The first step in adding a database to visual basic project is going to Project -> Add New Item…

Select SQL Database

Right Click Tables -> Add New Table
Chapter3_Prog1_002
Add the colums and their data types

Primary key – foreign key relationship can be found under the menu-relationship
Chapter3_Prog1_003

After adding the database connection to the data source, you can now drag tables or do other manipulation with the data

Chapter3_Prog1_004
To download the source code for this program, click here

A simple internet Browser

editVisual Basic / programmingcomments1 Comment »
March 19th 2008

It’s very exciting isn’t it, in the second program, We are attempting to create a customized simple internet browser. My program consist of the following controls:

1 WebBrowser (the web content area)
Name: BrowseWindow

3 buttons (HomeButton, BackButton, Button_1)

Some thoughts: The browser is very simple, address does not address content of the web. Maximize, content area does not, future considerations.

Code

Public Class Form1

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

BrowseWindow.Navigate(TextBox1.Text)

End Sub

Private Sub BackButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BackButton.Click

BrowseWindow.GoBack()

End Sub

Private Sub HomeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HomeButton.Click

BrowseWindow.GoHome()

End Sub
End Class

Screen shot (click to enlarge)

Chapter 1 Program 2 Screen shot

download Chapter 1 Program 2 Code download

Chapter 1 Program 1: Hello World!

editVisual Basic / programmingcommentsNo Comments »
March 17th 2008

This is the typical hello world program:

Control involved: 1 button:

Code:

Public Class Form1

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

MessageBox.Show("Hello World")

End Sub

End Class

Screenshot:

Chapter 1 Program 1

download Chapter 1 Program 1 source code

Hello VB!

editVisual Basiccomments1 Comment »
March 17th 2008

Just recently, I really wanted to pick up and start to learn visual basic again. It is a relatively simple and fun programming language that’s easy to learn. I’ll be using visual basic express 2005. The programs I will be coding will be posted regularly as well as the program code.

To download Microsoft Visual Basic Express 2005, you can click here
To download the SP1  (Service Pack 1), click here.

To download all visual studio express 2005 (ISOs), click here

Alright, let’s get started!

Cheers!