Visual Basic™ Framework

Software Eng. : Enhanced Payroll Program

[ Previous ] [ Basic Topics Index ] [ Next ]

How to add a start-up page to the program

 

1.      Add a start-up page to the program.

TIP

To add splash screen form

 

Ø      To create a new form, at the toolbar, click ‘Add form’ icon  or select ‘Add Form’ from the ‘Project’ menu.

Ø      Select ‘Splash Screen’ form.

Ø      Name it ‘front_page’ and type “Enhanced Payroll Program” in its caption field.

 

2.      Modify the introductory information as in the following form to advertise the program.

3.      Add a command button ‘Start’ to move to the ‘Payroll2’ form, and set the (Name) and caption ‘Start’.

4.      Type the following codes for ‘Click’ procedure on the object ‘Start’ command button. At the ‘front_page’ form, you may copy and paste only the bolded codes to the respective object and procedure.

Object: ‘Start  -  Procedure ‘Click

Private Sub Start_Click()

    front_page.Hide 'Hide this form

    Load Payroll2       'Load the form called payroll2

    Payroll2.Show       'Show the form

End Sub

 

5.      At the ‘front_page’ form, modify the ‘Load’ procedure for the ‘Form’ object.

Object: ‘Form  -  Procedure ‘Load

Private Sub Form_Load()

lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision

End Sub

 

6.      Make this form the start-up form.  In the ‘Project’ window, choose the Project folder. Select ‘Project’ menu and click on ‘Project Properties’ menu item. Set the Start-Up form to ‘front_page’. Click “OK” button.

7.      Test your program.

TIP

In the program, select an employee and key in the employee’s Overtime. When the user presses Enter in Overtime, the program will calculate the pay cheque amount.  The program will stop when the 'Quit' button is clicked.

 


NOTE

With employee Mr. Raja’s Overtime = 50, his amount of Pay Cheque :  _____________

ALERT

Congratulations! Record End Time:  _____________


Back to top

What next?

Try to make the program more robust by putting in more error checks in the codes.

 

Back to top

 

Last revised: 30 January 2004        16:00

 

If you spot an error, please contact sbho@mmu.edu.my   In addition, please contact me if you find some aspects of this task is not explained clearly so that I can improve this documentation.