Prof. Steven Battilana, Computer Science (CSC) Dept., West Chester University (PA)

While focused primarily on WCU CSC students, this website also contains, and provides links to
FREE and very low cost academic and business resources including the "inc. gauge" KPI tool

Home | Hot! | Syllabus | Schedule/Assignments | VB Tips | Free/Low Cost Academic/Business Resources


Prof. Battilana's VB Tips - CSC 110

This page is for ALL CSC 110 Sections as a supplement to the VBSA Guide and class material.


Office Hours week of 12/11: 3:15-4:00 Mo; 4:30-5:45 TuWeThFr (END of semester for courses with Prof. Battilana)


Submitting VB Files/Folders
(Differs from VB Guide Method)

  • Logon to D2L

  • Click Assessments then
    click Assignments

  • Click the link that corresponds to what you are submitting, e.g., "Lab 1...", etc.

  • Click the Add a File button

  • Click the Browse button, open your CSC110Student folder, then right click on the Lab folder. Mouse over Send To, then click Compressed (zipped) Folder. This will create a new file with the same name as the folder, (in this case Lab) and will have a zippered folder icon next to it. Click this newly created file, then click the Open button.

  • Click the Add button, then click the Upload button. You can add a comment (not usually needed) then click the Submit button.

  • You will see a File submission successful comment, and an email confirmation is sent.

  • You will not see a grade until your instructor has posted it.

 Using These VB Tips
in CSC 110

These tips were created to use with VBSystemApp (VBSA) Guide, instruction in class, and the lab work that you do. They are not a replacement for any of these items, but you should find them very useful.

 Helpful Thoughts for
CSC 110 Success

  1. Get Labs in on time - as expected per the samples, and done well.

  2. Communicate - if you can't get in, let your professor know and get caught up.

  3. Ask questions - especially for the VBSystemApp (VBSA) Guide material. Quick office hours visits really help!

  4. Come to class - students that attend and participate have proven to earn better grades.

These Tips are for any students using Dr. Fabrey's VBSystemApp (VBSA) Guide.

You are learning a new language, so to succeed: 1) be very focused during class; 2) carefully read the Guide; and 3) ask relevant questions during class.

Chapter 2 selected items:

This is an excellent chapter; make sure to read the VBSA Guide and do the exercises!

  • Text boxes were used for messages, accepting messages from a user InputBox, strings of characters were entered, and math was performed using text box content.

  • Random numbers were generated using the procedures of Flip (1 of 2 possible outcomes), Spin (1 of 4 possible outcomes), Roll (1 of 6 possible outcomes), and finally using random (1 of n possible outcomes, with n = a number we select).

  • Concatenation allows us place two or more items side-by-side, e.g., the text from a Name text box & a message. We used the ampersand symbol (&) to concatenate.

  • MsgBox was used to create customized messages, even with concatenation.

Lab1CreditRandomSpinRollTravel (for students in Prof. Battilana's VB Labs -- otherwise check with your CSC110 professor). Run Lab1CreditRandomSpinRollTravelEncrypted to see how it works. What is familiar and what is new?

Create the form using "VBSA" - you can do this on any PC running Windows. You will add two buttons, three textboxes, two listboxes, and two pictures (1 = ThumbsUp; 2 = Dice 1. Neatness counts - your completed form should look exactly like the original RandomMotion; the exact size and position it should be in (TOP, LEFT, HEIGHT, WIDTH). The text for the Form should contain the name of the Lab and your full name.

Save your work in the folder named:   LastnameFirstname1

Coding Tips - Available in D2L Th 2/15.

Chapter 1 selected items:

VBSA Use Tips:

  • Hit the Enter key after every entry

  • Save frequently from within DESIGN mode

    • Click folder on your flash drive, then OK button (two different times)

  • STOP and ask a question if you see any popup warnings

  • Creating e a NEW folder (using Save in bottom left quadrant):

    • Click OK button, then carefully pick a location on your flash drive

    • Click Make New Folder button, type in folder name, then hit Enter key

    • Click new folder name then click OK button (two different times)

  • When setting object Properties or Coding, the top of the top right quadrant must show the name of object you are working on!

Interchangeable Terms: Program = PROJECT; Window = (Business) FORM; Instructions = CODE. We will tend to use the 2nd of each interchangeable term.

Using VBSA, we:

  • 1) DESIGN Forms, placing Objects like buttons, listboxes, pictures, textboxes, and lines on it (the Form is also an Object. We also set the Properties of the Objects, like text, fore color, back color, size, and positioning. 2) Write CODE for some of the Objects; usually those that are activated by the user by clicking them, and in some cases, simply loading (running) the program. Much of the code is pre-written procedures that are stand alone, or that are used in conjuction with code we write. 3) We RUN programs we have created as a means to test and debug them to ensure they work as we expect.

Code we discussed in this chapter thus far includes:

  • Speed, which allows the user to pick a speed for travel (lower numbers are faster. The code is simply "Speed" (placed on a button named "velocity").

  • End, which allows users to end a program. The code is simply "End", (placed on a button named "Exit").

  • Selecting and sizing images onto a picture object and moving it was is done by "PictureNumber.Image = ImageName", "PictureNumber.Width = Constant(pixels)", "PictureNumber.Height = Constant(pixels)", and "travel [direction | ObjectBeingMoved | distance (pixels)]" respectively.

  • In Lab1Practice1MovingCar we also took a brief look at MsgBox, custom message boxes for users, vs. WAIT (a pre-written message box to delay user while a procedure finishes running, which we will also be using).

  • Repetition of code using a For Loop was used to move a picture in a counter-clockwise direction using only 4 lines of code. The code used was to first select the "TextboxName; we used "n"", then "=", "Constant (starting number; we used "1")", "To", "Constant (ending number; we used "4")", then finally clicking the "Add" button. This creates the code structure starting with "For n 1 to 4", a blank line, then a new line with the ending code "Next". We replaced the blank line with 2 lines of code, which runs 4 times, with n changing sequentially from 1 through 4. The 1st line "List1.Index = n" selects directions in List1 starting with 1 (East), then 2 (North), etc. The 2nd line "travel List1 Picture1 120" means travel = cause to travel; List1 = direction from List1 based on n; Picture1 = object that will travel; 120 = 120 pixels of movement.

  • Simple code to move a picture in a clockwise direction, but in 8 lines of code vs. 4 using the For Loop (above) Movement (travel) using a numbered direction from a Listbox and the travel procedure. The 1st line of code, "List1.Index = 3" means the direction will be index 3 (West) in List1. The 2nd line used the travel procedure, specifically "travel List1 Picture1 120", where travel = cause to travel; List1 = use selected direction (West from 3 in 1st line)"; Picture1 = object that will travel; 120 = 120 pixels of movement.

Simple, but important Random Number Selection code includes:

  • Random Number uses the code "random TextboxNameOfOutcome TextboxNameOfMaximumNumberSet". We used the code  "random Number Max".

  • Flip generates a random number of 1 or 2 and is used for coin flips where 1 = heads and 2 = tails. The code is "flipCoin TextBoxNameOfOutcome PictureNameToShowHeadsOrTailsImage". We used "flipCoin Number Picture1".

  • Spin Listbox a random number from 1 to 4 and is used for compass directions in this chapter. The code is "spin TextBoxNameOfOutcome ListboxNameWithDirectionsIndex" and we used "spin Number List1".

  • Roll Die generates a random number from 1 through 6 used to represent the possible outcomes of the roll of a die. It uses the code "rollDie outcome PictureNumber", where outcome = TextBoxNameOfOutcome and PictureNumber = PictureNameToDieImage).


Office Hours

room UNA 146

[same building as bursar's & registrar's offices].
Other hours: see your syllabus.

CSC 110 Links
and Downloads

VB Demo/Lab Programs: D2L

VBQ Prep Lab

WCU E-mail

Help Desk


L3P1TT1 vs P2TT2


What's this?

VBSA Guide

Copyright 2000-2018 Steven Battilana. 610.430.4198,, CSC Dept., UNA 150, West Chester University, West Chester, PA 19383