Sunday, March 29, 2009

VB.Net OpenFileDialog

OpenFileDialog in VB.Net allows the user to browse for a file and open it.

Properties of the OpenFileDialog are as follows:
  • AddExtension: Gets/Sets if the dialog box adds extension to file names if the user doesn't supply the extension.
  • CheckFileEixsts: Checks whether the specified file exists before returning from the dialog.
  • CheckPathExists: Checks whether the specified path exists before returning from the dialog.
  • DefaultExt: Allows you to set the default file extension.
  • FileName: Gets/Sets file name selected in the file dialog box.
  • FileNames: Gets the file names of all selected files.
  • Filter: Gets/Sets the current file name filter string, which sets the choices that appear in the "Files of Type" box.
  • FilterIndex: Gets/Sets the index of the filter selected in the file dialog box.
  • InitialDirectory: This property allows to set the initial directory which should open when you use the OpenFileDialog.
  • MultiSelect: This property when set to True allows to select multiple file extensions.
  • ReadOnlyChecked: Gets/Sets whether the read-only checkbox is checked.
  • RestoreDirectory: If True, this property restores the original directory before closing.
  • ShowHelp: Gets/Sets whether the help button should be displayed.
  • ShowReadOnly: Gets/Sets whether the dialog displays a read-only check box.
  • Title: This property allows to set a title for the file dialog box.
  • ValidateNames: This property is used to specify whether the dialog box accepts only valid file names.

UML Class Diagram

UML stands for Unified Modeling Language. A UML Class Diagram is a static structure diagram that describes the structure of a system by showing the system's classes their interrelationships, and the operations and attributes of the classes.
Class Diagrams must show:
  • Classes
  • Responsibilities
  • Associations
  • Inheritance relationships
  • Composition associations
  • Vocabularies
  • Interfaces

Friday, March 27, 2009

Week 7

This week we looked at the Select Case statement. It allows for lots of different operations to occur depending on the value of a single field. In the Select Case program we made we also looked at having something occur depending on which button is pressed in a message box. In this case it was asking if they wanted the text displayed to be reversed.

Next we started making a program called Cats And Dogs.
We had to create 2 classes for this exercise, 1 called Cat the other Dog.
Within each class we had to declare 3 properties, Name, Age and Breed through the Public _ keyword, instead of Dim, and 3 Methods.
Both had a "New" method which is the constructor for the class, the Dog Class also had 1 method called Bark and another called GoWalkies, the Cat Class had 1 method called Meow and another called Chase Mouse.

Monday, March 23, 2009

vb.net Classes & Objects

A class is a type and an object is an instance.
A class is the code itself, the code becomes an object when you start using it.
Objects have properties and methods.

Friday, March 20, 2009

Week 6

This week we looked at creating a program for a mobile device. We did the Guided Program Development task from the end of Chapter 5 called Wood Cabinet Estimate on page 351. This step-by-step allowed us to create a Smart Device Application which calculated the cost estimate depending on the amount of linear feet and the type of wood desired.
We then created the Parking Ticket Fines program found at the end of Chapter 5 in the Programming Assignments on page 370. It is very similar to the Wood Cabinet Estimate program and is also for a mobile device.
Then we had a TEST on Chapter 4 of the book. It contained Multiple Choice questions, True or False questions and complete the sentence questions. It had a possible 86 marks of which I scored 86.

Friday, March 13, 2009

Week 5

This week we moved on to Chapter 5 and looked at IF statements, ELSE Statements and ELSEIF statements. These allow the program to only run a certain piece of code depending on what the user does. We also used a few new tools, group boxes and radio buttons.
We had to create a program that compared two strings to see if they were equal (=), less than (<) or greater than (>) each other. The result was then displayed in a Message Box. To avoid the program crashing if the user doesn’t enter something into both text boxes we used an if statement at the start of the code, If txtString1.Text <> "" And txtString2.Text <> "" Then, if there wasn’t anything entered we had to display a Message Box with an error message warning the user to enter something into both text boxes.

Monday, March 9, 2009

ASCII & Unicode

ASCII is the name given to the 256 characters and symbols that make up English and most Western European languages, it is not capable of displaying most other languages such as Asian languages. That is where Unicode comes in. It contains more than 65000 characters and is capable of displaying all the worlds languages, even ancient ones. The first 256 characters of Unicode are the same as ASCII. Visual Basic uses Unicode as its coding system.

Friday, March 6, 2009

Week 4

This week we looked at creating a simple web browser. We used the web browser tool to display the web page; in the code we used wbBrowser.Navigate(strURL) to go to the desired page, (strURL refers to the declared string variable that holds the URL). The form also contained a Back, Home, and Forward button, a text box where the user can type a URL with a GO button that will get the web browser to go to the typed URL, and a Favourites button which will add whatever page is currently loaded into a comboBox.
Then we had to complete the second Programming Assignment of Chapter 4 on page 281, called Taxi Fare. This program is similar to both the Digital Downloads Program and the Concert Tickets Program.