Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 24th, 2007, 12:58 AM
Registered User
 
Join Date: Feb 2007
Location: Saint John, New Brunswick, Canada.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default working with multiple forms

VB 2005

I am a student in programming, in term 2, have 6 months experience with vb, we have just started multiple forms this past 2 weeks. I have been given a lab (which is already 3 days overdue--so I already got zero on the lab---cross my heart), but I have a midterm on Wednesday and don't understand how to work efficently with multiple forms. Even though I didn't pass in the lab (first vb lab I was late for since I started the course, normally I get an A on all assignments, but we just started another course C++ and I am super overloaded with stuff there as I am completely new to C++). I need to know how to do it for the midterm, because we won't get a copy of the answer key to this before the midterm.


Here is the lab:

Write a program for the problem described below. The assignment will be written as a Windows Application with a project name of VB-Cell.

Cell Phone Packages

VB-Cell, a cell phone provider, sells the following monthly packages:
300 minutes $35.00
600 minutes $60.00
1200 minutes $89.00

Customer may also select the following features:
Basic Voicemail: 3.95 per month
Deluxe Voicemail: 5.95 per month
Text messaging 7.95 per month

VB-Cell sells the following phones:
Model 100 19.95
Model 101 34.95
Model 200 99.95

Additionally, the provider offers individual plans. With the individual plan, the customer gets one phone. With the family plan, the customer gets as many of the same model phone as he or she wants and all the phones share the same minutes. Features, like voicemail and text messaging are charged for each phone purchased under the family plan.

You will need to create an application that calculates the plan costs. The main form should appear similar to the one shown below(I can't paste this so I will just word it):

Form1:

Select a plan:(group box)

"The individual plan provides one cell phone and a variety of monthly packages:" button: individual plan

"The family plan allows you to purchases multiple phones of the same model, with each phone sharing ne monthly package." button: family

exit: button

End of form1 called VB-Cell Phone packages
-------------------------------------------------------------------

When the user clicks the Individual Button or the family button, the appropriate form as shown(I will write out) should appear. These forms should be displayed as dialog forms. Note that it is possible to have only one form for both these and hide or show the controls that are different. Clicking on the exit button will stop the program. For the buttons on this form, allow access keys.

Form2

Individual Plan

Group box1: Select a form
In group box1: 3 radio buttons(Model 100, model 101, Model 200)

Group box2: Select a monthly package
In group box2: 3 radio buttons(300 minutes, 600 minutes, 1200 minutes)

Group box3: Select Features
3 Radio buttons(No Voice Mail, Basic Voice Mail, Delux Voice Mail) 2 selection boxes(Text messaging, Call display)

Group Box4: Summary of initial charges
label: Phones, with matching text box (to later display summary info for client)

label: Features, with matching text box (to later display summary info for client)

label: Package, with matching text box (to later display summary info for client)

label: Sub-Total, with matching text box (to later display summary info for client)

label: GST(tax in canada), with matching text box (to later display summary info for client)

label: Total, with matching text box (to later display summary info for client)

Then at the bottom of this form are two buttons: followup, and close.

Form3 is exactly the same as form 2 individual plan, except it is named 'family plan' and has a text box for the user to select the number of phones.
-------------------------------------------------------------------

The user selects the phone model, the desired features and the package. As the user makes their selections, the applicable costs will appear in the "Summary of initial Charges" group box. To do this you will use events of the radio buttons and checkboxes. Note that a GST of 14% needs to be computed and UPDATED as any charges are made. You should place code in the form load event to compute the costs for the default selections. The only difference under the family plan is that the user must also enter the number of phones which should default to be one.

When the FOLLOW UP button is clicked, you will use the InputBox method to request the user's name and phone number. A sample dialog is shown below:

Input Box: "Sales Follow up"
"Enter your name and phone number:"

OK or Cancel, and a place for user to type in info.
--------------------------------------------------------------------

If the user enters some information and clicks OK then append this information along with the details of their order to the file name "C:\VB-CellSalesLeads.txt."

---------------------------------------------------------------------

The last task is to create a Splash screen for your application. Instead of adding a regular Windows Form, choose the Splash Screen and with the help of a Timer control make it so that the splash screen shows for three seconds as soon as the program begins. Thereafter it should be removed from memory and the main screen to select a plan should be displayed.
__________________________________________________ ___________________

Well this was fine, but then the instructor said we would be too pressed for time so he gave us a file that already had the forms made (but not the splash screen made). But if you try to run it you get the error: "SelectForm is not a member of "Lab3_VB_Cell".--What does this mean???? If you run it on the last successful run option then it works fine, the form comes up where you can select individual or family and if you press one of those buttons it leads you to your applicable selection form, which the user fills out and then presses the followup or close button if the choose.

The forms look as though they are all already linked to eachother(based on the last successful run), and I will have add the math for the calculations as only the default selections look as though they are coded. But my problem is I can't find the code, and don't know where to do my coding. I am used to creating single forms and just doing the math by the applicable events as I create the form. And I don't know how much code is already done. If I click the form in design mode and select view code there is no code there.

In the application designer is already the following code, underlined is the error:

'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.42
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On


Namespace My

    'NOTE: This file is auto-generated; do not modify it directly. To make changes,
    ' or if you encounter build errors in this file, go to the Project Designer
    ' (go to Project Properties or double-click the My Project node in
    ' Solution Explorer), and make changes on the Application tab.
    '
    Partial Friend Class MyApplication

        <Global.System.Diagnostics.DebuggerStepThroughAttr ibute()> _
        Public Sub New()
            MyBase.New(Global.Microsoft.VisualBasic.Applicatio nServices.AuthenticationMode.Windows)
            Me.IsSingleInstance = false
            Me.EnableVisualStyles = true
            Me.SaveMySettingsOnExit = true
            Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.S hutdownMode.AfterMainFormCloses
        End Sub

        <Global.System.Diagnostics.DebuggerStepThroughAttr ibute()> _
        Protected Overrides Sub OnCreateMainForm()
         [u] Me.MainForm = Global.Lab3_VB_Cell.SelectForm</u>
        End Sub
    End Class
End Namespace

---------------------------------------------------------------------

My midterm Wednesday is on just 3 chapters of Visual Basic 2005 (Dietel& Dietel). Chapter 8 on Arrays, Chapter 12 on Exception handling, and Chapter 18 on files and streams. Files and stream tells me how to deal with the follow up form, but we had no assigned chapter to work with splash or multiple forms, even though we were given a lab for it, we were just taught in in class.

I am new to these forums, just found this site and signed up tonight.




ok
Reply With Quote
  #2 (permalink)  
Old March 1st, 2007, 06:48 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I believe that that means that Lab3_VB_Cell has nothing in it called SelectForm.

When you type “Me.MainForm = Global.Lab3_VB_Cell.” is there anything in the intellisense list like SelectForm, but spilled slightly differently?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C# classes working for multiple forms w/ reseting Nathan Fleming C# 2005 1 September 11th, 2006 04:45 PM
Multiple forms simen C# 2005 1 February 8th, 2006 08:15 AM
Working with Forms and Date in Javascript danieljava Pro JSP 1 January 16th, 2006 05:56 AM
Working with Forms and Popup window in Javascritp danieljava JSP Basics 0 November 20th, 2005 09:57 PM
Working with forms cutovoi Excel VBA 1 January 23rd, 2004 07:18 AM



All times are GMT -4. The time now is 04:06 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.