# !Help on Visual Basic Project!



## Nameisnobody (Oct 3, 2006)

I'm doing a Visual Basics project that deals with me creating a ficional distribution firm that sends several trucks full of manufactured goods to the United States each day.

The warehouse staff assembles the containers (mostly boxes) on the shipping dock and they'll use the program that I'll write as they load the trucks.

The information they need as they are loading is:

- information about each truck and each container
- whether or not they are overloading each truck.
Some problems that I'll help them overcome are:
- US customs want the volume and weight figures in Imperial measure, but some of the containers are
labeled in metric
- trucks that are overloaded, either by weight or volume (some trucks are boxes and some are flatbeds),lose their insurance coverage because they are deemed unsafe.

I have to create a Visual Basic program that contains text boxes, command buttons and labels. My assignment says that the Visual Basic program has to be contained in a single form which includes 7 command buttons of:
-Accept Truck Button
-Load Container Button
-Finish Truck Button
-Encode/Decode
-Print Button
-About (displays my name and date and such)
-Exit button

Can you guys offer any pointers or help to this newbie VB programmer.


----------



## wateva (Apr 24, 2006)

What do you need help with? What are encode/decode and finish truck buttons supposed to do?


----------



## Nameisnobody (Oct 3, 2006)

Hope this helps

1) Accept Truck Button
The user must push this button after entering the first (or next) truck&#8217;s id and weight and volume capacity.

2) Load Container Button
The user must push this button after entering a container&#8217;s weight and volume, and if appropriate, something into the metric indicator textbox.

3) Finish Truck Button
The user pushes this button when he will no longer add containers to the truck - either because it&#8217;s full or he has run out of containers.

4) Encode/Decode
(Set up this command button with the caption "Encode".)
If the button caption is "Encode"
- change the title label from Smith Shipping to Shipping htimS
- change the caption to "Decode" 
If the button caption is "Decode"
- change the title label from Shipping htimS to Smith Shipping
- change the caption to "Encode"
This must be done using a loop and string manipulations.
Instead of Smith or htimS, use your surname.

5) Print Button
This button can be pressed any time. All the displayed information will be printed on the default printer. The command for printing the form is PrintForm.

6) About
Use a message box to display your name as programmer and the date you completed the program, when the About command button is clicked.

7) Exit Buttons
The Exit command button exits the program.


----------



## Nameisnobody (Oct 3, 2006)

I'm a newb in this, so I think I may need help in everything 
Especially how to start this this.


----------



## dquigley (Apr 17, 2006)

To start break down the assignment into steps:

1) Create the form - drag and drop the controls (buttons, textboxes, etc.) 
2) Arrange them so they look good and are grouped logically
3) Change the IDs (Name) so they mean something (not just the text on the buttons)
Example: Button2 change to AcceptTruck
4) Then add code to the ButtonName_Click events - start with the easiest first like Exit or PrintForm

or

Add one Button/Feature to the form at a time and add the appropriate code to each Click event handler. Start with the easiest first so you get the hang of it. Like the Exit button.

Here is an example of the Click event handler for a button on Form1 named ExitProgram.


```
Public Class Form1

    Private Sub ExitProgram_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitProgram.Click
        Close()
    End Sub
End Class
```
Best,
Dan


----------



## wtfisgoingon (Oct 21, 2006)

i just googled "Visual basic truck assignment" hoping my prof copied the assignment from somewhere, are you enrolled at UTSC and is this for CSCA02?


----------



## Nameisnobody (Oct 3, 2006)

lol, wow, of all the sites, of all the forums, you come into my thread...
so it seems you have found my post concerning that most dreaded assignment.
Truly, 'wtfisgoingon' is what I said when I saw that work.
I'm in the same class as you, and I am also looking for help on it.
I'm so lost, but I'll be studying the book and slides for now, since I don't have 
Visual Basics at home.


----------



## mepatrick (Oct 22, 2006)

Seems like I've got the same problem. I don't even know how they want the layout to be. They say FOUR labels in total including the Title. How do I show ALL of these one just one label? ARGHHGHG. Anyone of you want to send me a print screen of your layout. Just want to see how it should look like. 

The truck label should display in 5 lines, for the truck being loaded:
identification
maximum weight capacity (lb) with no decimals
maximum volume capacity (cu.ft.) with no decimals
% of weight capacity used so far  to one decimal point
% of volume capacity used so far  to one decimal point

I'll probably drop the course if the midterm is too hard.


----------



## wtfisgoingon (Oct 21, 2006)

ive been trying all day to get the stupid label to display all 5 things on different lines and i cant do it, i swear im going to snap, get me on msn and we can maybe work this **** out in a group, [email protected]


----------



## dquigley (Apr 17, 2006)

The label control will start a new line when it encounters a carriage return character.

So...


```
Label1.Text = "This is line one" & Chr(13) & "This is line two" & Chr(13) & "This is line three"
```
Should give you three lines in the same lable.

Best,
Dan


----------



## Nameisnobody (Oct 3, 2006)

Ah thanks anyway guys, even though half of the buttons didn't work properly, I managed to get some of the buttons to be working. I easy ones that is.
Hope the other guys on the thread succeded with their work, cause for me, I spent to much time on this. But whatever, I did enough.
Thanks again.


----------

