Tuesday, 18 September 2007

Review Questions

1. The ______ is the working area provided by Visual Studio .NET
that is used to design, configure, and code an application.
a. Toolbox
b. Code Editor
c. IDE
d. Output window


2. A window that can be dragged to any location on the screen is a
_______________ window.
a. docked
b. floating
c. hidden
d. visible
3. The main window that is displayed when you start Visual Studio .NET is
the _______________ .
a. Start Page
b. Options dialog box
c. Visual Basic .NET editor
d. Designer window

More below the fold..
4. Many of the settings that affect the IDE can be modified from the
_______________ dialog box.
a. Design
b. Open Project
c. Options
d. Edit


5. If Auto Hide is turned on for a window and the mouse pointer is not in
that window, the window will be shown as a(n) _______________ on the
side of the IDE.
a. tab
b. button
c. list
d. icon


6. A console application is different from a Windows application because it
runs or executes in a _______________ window.
a. Designer
b. DOS-style
c. Form
d. Property




7. The naming convention that uses a capital letter for each significant word
in the name is called _______________.
a. Pascal-casing
b. Camel-casing
c. Hungarian Notation
d. Class-casing


8. Which of the following is not a type of project that can be created in
Visual Studio .NET?
a. Visual C# Projects
b. Visual Basic Projects
c. Visual C++ Projects
d. Visual D+ Projects


9. The small white squares that appear on all four corners and sides of a
selected form are called _______________.
a. sizing handles
b. dragging handles
c. control squares
d. sizing squares


10. Code that should run when an event is raised for an object should be
placed in a(n) ________________.
a. object handler
b. method
c. event handler
d. property


11. Visual Studio .NET is part of the Visual Basic .NET suite of programming
languages and tools. True or false?
False


12. Dynamic Help will display appropriate Help topics depending on what
you are doing in the Visual Studio .NET IDE. True or false?
True


13. The Toolbox, Output window, Start Page, and Solution Explorer are all
part of the Visual Studio .NET IDE. True or false?
True


14. The Auto Hide All item on the Window menu is used to “unpin” all windows
at the same time. True or false?
False


15. IntelliSense is the ability of Visual Studio .NET to create the forms you
need for your project after you have typed the code. True or false?
True


16. The Window menu is the menu that is used to locate the windows
that make up the Visual Studio .NET IDE.



17. The most commonly used toolbar in Visual Studio .NET is the
Toolbox toolbar.




18. The default location used to save your projects, in addition to other settings,
can be configured in the Options dialog box.


19. The Visual Studio .NET window that displays a list of the files and references
in a Visual Basic .NET project is called Solution Explorer.


20. A grouping of projects in Visual Studio .NET is called a(n)
Data Source.

Monday, 17 September 2007

Freemind...

Today in class we worked using Freemind, a program which allows you to create Mind Maps. We read through the "High Level Languages" and created a mind map based on this chapter.

This is what it looked like :


Sunday, 16 September 2007

The Petrol Pump Design

So, in creating a program, you have to first imagine what you want it to look like, before you begin working on getting it working.
So, the name of the company is "Peters Petrol Pumps" which, when you think about it, is an awful name for a company. For this company to have success, it needs to have a catchy name and playing on the basic english technique of alliteration isn't a successful name. K-Fox or something, is much better.
But, on with the designs.

There will be two basic displays needed for this program, or two forms in Visual Basic. One will be for the customer, the other will be for Peter Pumpkin who'll need to check how much money his Petrol Pumps are raising, never mind his Diesel Pumps. So, first off, we have the customers petrol pump, which needs to display the amount being put into the car, the amount it costs for the amount they've put in, and the cost per litre.

The form, should look something like this :




Then, we have Peters Form, which has to display, the total for the day and the amount of money made per day :



More design information will be posted in the next few days.

Peter’s Petrol Pumps

Over the last few days, we've been working on implementing a "7-Segment LCD Number Display" and after getting the display working for the numbers 0-9, we were then asked to expand on this so that when a user inputs a number such as "23" into a text box, it showed up the number 23 on the LCD display.

This took a few hours to get working sucessfully for numbers up to and including "999" but the program still had a few bugs (Such as, if the user was to enter "1000", the display would only show "100" and the end 0 would be dropped off.) which have yet to be fixed.

It would be pretty easy to get it working for a fourth digit, but the coding that goes into this is a bit clumsy and instead of just expanding on it so that the program can work with numbers up to 9999, I'm still working on getting a shorter amount of code to be able to cope with any number which is inserted into the program rather than the numbers I have set aside.

The reason we've been working on this LCD Display program was for the build up to the Module 3 resit paper which requires you to create a program for a petrol station and the display has to be an LCD one.

Computing AS/A2 Page:
http://www.aqa.org.uk/qual/gceasa/comp.php

This is the coursework/program which I'll be looking at over the next few months.

Tuesday, 11 September 2007

Part 5 : Adding a Title Bar

So, you've created the browser and you're a bit more familiar with how Visual Basic 2005 works. Now I'm going to show howto add a title bar to your site.
So, open Visual Basic, and open your website project.

So, from the tool bar, scroll down through the toolbox and go to Menus & Toolbars, what we're looking to add is a Menu Strip.
Drag it onto the form and you'll be greeted with an extra slot at the top of your page which allows you to create a menu like you're used to seeing in all your usual applications.
I'll add a "Close Program" command and a Back And Forward navigation to the application and leave the rest for you.

So, in your menu bar, put the tags you want in but, make sure you include "Close", "Back" and "Forward" in there somewhere.

Coding for "Close"

The Code for ending an application is really simple, and can be done by simply putting "End" in your code somewhere. Because we want the program to close when "Close" is clicked, what you do is, double click on your "Close" command tag in your Form and it will again bring you to the code of your program. Just type in End and that is all. Now, when End is clicked, the program will exit.



Going Back



Going back is coded quite similiar to Close in that, all you have to do is type one line of code in the "Back" section. So, Double Click on Back and it will take you to the code section. All you have to do is type :

WebBrowser1.GoBack()

Now, when Back is clicked, your browser will go back a page.



Going Forward



Going forward is the exact same as going backwards exact that in the ".GoBack" tab, you type ".GoForward". Now you've got a browser which can go back and forward pages like every other browser.



That's all for now, next I'll show you how to create a bar at the bottom which shows the complete URL of the page you're visiting.

Making A Web Browser Pt4

Part 4 : Coding

So, we're ready to start. This should be the hardest part but to create a working web browser in Visual Basic, it's ridiculously easy.

We have to think about what we want this browser to do:



- User Types in URL

- User Presses Go

- Page Loads



So, really, it's only when the user presses go that the program does something.



What we're looking to do therefore, is insert our program instructions into the Go button. In Visual Basic, this is done by double clicking the item which we are looking to code for. Now, there are other ways to do this, but, this is the easiest way in this situation. So, double click "Go" which is still referred to "Button1" within the program.



You should be greeted with a page of code. This is where your entire program is run from!



If you look closely, it says "Button1_Click". This means that whatever you type inside this section will run when Button1 is Clicked. So, we want (if you've kept the item names the same) Webbrowser1 to navigate to the address typed in Textbox1.
This is done by typing in :





This code, when we analyse it isn't that complicted. With Visual Basic, if you type a controls name (I.E : WebBrowser1), and press ".", it will bring up a list of controls within that item. You'll notice this when you type in WebBrowser1 yourself and you'll see a lot of other useful expressions which this item can perform (GoBack for example will help if you want to go back a page.).
Navigate makes the browser go to a page and whatever you type in the brackets is the page it goes to. If we wanted the browser to go to a set page, we could have typed in "www.google.com" and the browser would have went to Google everytime we pressed go but because we wanted the Browser to go to whatever URL which was typed in the textbox, we type "TextBox1.Text".

Simple... Now, run your browser and see what happens when you type a URl and press go.



Making a Web Browser Pt3

Part 3 : Clean-up and Prep.


So,at this stage, we have our interface for which we'll build the Web Browser. Next up, I'm going to clean up some of the smaller things so that the browser is easy to use .
Click on the Web Browser component (Titled : WebBrowser1) and look at the properties window on the right. Find the tag called "Anchor", and change it so that the top, bottom, left & Right are greyed out. This means that when the browser is resized, the page will resize too.



Next, you can change the "Text" in the button box so that it says "Go" so that the user will know to hit go when they've typed in the URL.
Next up I'd advise that you resize and move your text box and stuff about the page so that you're happy with what you have. Then we can move on to coding.



Browser Ready to be Coded :


Making A Web Browser Pt2

Part 2 : Layout

So, you've opened up Visual Basic and you've created the project that will become your web browser.

Before I start, I recommend 'pinning' the toolbox open because we'll be using it quite a bit.


Drag and drop a text box onto your form and place it where you want.










Now we need to drag our Go button onto the page.It's basically just a button so what we use is a 'Button'.











Next up, we do what is in theory a hard part, but, Visual Basic makes dragging a web utility onto a page easy. What you do is, drag a "Web Browser" onto the page. As mentioned before, all these items are found on the toolbar, and the Web Browser is found at the bottom of the "common controls" section.











Next up, we'll look at how we code this program, in the mean-time though, I'll show you how to clean up some of the little problems that you might want to fix after you finish creating the browser.

Making A Web Browser


Part 1 : What's Needed?





I'm going to create a webbrowser using Visual Basic 2005 Express Edition which is free to download and use.
This is the step by step guide on how to do it.



So, open up Visual basic 2005 and we'll get started.


Click on Create : Project on the left side of the program and create a windows application.






Then, you'll be shown the form which will become your program in design view. The visual basic suites are good to use because they allow you to create programs and applications with ease.
Have a play around with some of the properties in the right window to see what they do.

I.E : Change the name of your form to something which you can relate to, like Frm1 (but, for the sake of this post, I'm going to leave everything the default name it is given.



So, first off, we need to work out what is needed in a basic web browser.





  1. Address Bar.
  2. Go Button.
  3. Page Display.



I'll show you how we're going to start in the next post.

Wednesday, 5 September 2007

Tables

So, continuing on form where I left off, over the past few days I've been learning HTML and now, past the more basic <b> code, I'm onto more difficult stuff which I'll mention in this post...


Because this blog uses html, when I try and post a command it automatically converts it so for that reason, I'm going to use Notepadd++ and take screenshots whilst I'm explaining what I am doing.


Tables



To create a table using HTML you use the <table> syntax:





The image above shows you of some of the table commands which help distinguish between headings, row and cells.



I'll continue with another post as I work on ...

Tuesday, 4 September 2007

Mondays Class and Revision

In todays class we went through the website W3Schools looking at HTML and XHTML tutorials.
Some of the stuff I learnt was that :



  • HTML files are Text files.

  • They give the browser commands i.e:

  • Bold Italic and Underlined text.

  • BUT, they need to be closed using commands, i.e:
I used some of the tutorial sites from W3Schools to help me in creating HTML files.

More commands are :


  • Line Breaks which put text onto a new line
  • Paragraph makes text take a new paragraph.

Also in the class, we worked on Notepad++, which is just like Notepad only it has far more functions and support for coding.




HTML Codes:








Links :
http://www.w3schools.com/html/html_examples.asp
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_basic
http://www.w3schools.com/html/html_quiz.asp
http://sourceforge.net/projects/notepad-plus/

Sunday, 2 September 2007

Right so...

Hah.
Coursework blog.
Here.

:)

Q: Can we post some random stuff on here as well (I.E : Windows is Lethal, Linux isn't.)
A: Yes.

:D