Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab8 Working with Forms Forms Collection Multiple Forms.

Similar presentations


Presentation on theme: "Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab8 Working with Forms Forms Collection Multiple Forms."— Presentation transcript:

1 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab8 Working with Forms Forms Collection Multiple Forms

2 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 2 Screen Object Properties: Screen.width : Specify the user screen width. Screen.height : Specify the user screen height. You can use these properties to specify the from location on the screen. Example: to center the form on the screen at the Run-Time: Form1.Left = (Screen.width - Form1.width) /2 Form1.Top = (Screen. Height - Form1. Height) /2

3 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 3 Form Collection The group of forms currently defined in the application. From Project Properties window you should specify the Startup From. Index Property: Each form in the form collection has an index starting with 0 for form1, 1 for form 2 ….

4 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 4 Referring to the form in the form collection 1- Using the form name Example : Form1.Text1.text = “ PPU” Form2.Caption = “StdRecord” 2- Using the index property Forms(index)!ControlName.Property = Value Example: Forms(0)!Text1.ForeColor = vbRed Form(1)!Caption = “StdRecord”

5 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 5 3- Using Me to refer to the active form. Me!ControlName.PropertyName= Value Count Property: Shows the number of open forms Forms.Count Example Print Forms.Count

6 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 6 Forms Events Load: Occurs during adding the form into main memory. UnLoad: Occurs during removing the from from main memory Activate: Occurs when the form becomes active. Deactivate: Occurs when another application or form becomes active. Resize: occurs when the user resizes the form.

7 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 7 Forms Methods Hide: Hides the form but it is still loaded into M.M. FormName.Hide Show: Shows the form at the interface. FormName.Show Print: Use to place text on the form. FormName.Print ------

8 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 8 Multiple Forms Single Document Interface (SDI) –An application that contains single data window. Multiple Document Interface (MDI): –An Application that contains multiple data windows. –This type of interface contains: Parent form that acts as a form container. One or more Child forms

9 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 9 Creating MDI Applications 1- From the project window => Add MDI form. 2- Add one or more forms. 3- Change the MDIChild property for each form to True. 4- Use Hide, Show properties in a suitable way for the child forms. When you run the program the out put should be one main form(container) that includes several forms inside.

10 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 10 Lab Training Using the MDI, design an interface to accept the student data in three forms as follow: Form1: Accepts the student personnel data, which is: Student name, Birth date, Birth place, Tawjihi major, Tawjihi average, Tawjihi year. Form2: Accept the academic data: Student college, Student major, Student level, Student supervisor. CONT….

11 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 11 Lab Training [CONT] Form3: Student current registration: Current academic year, current semester, Courses registered. ---------------------------------------------------- Form4:print the whole student information form Form1,form2 and form3 in labels

12 Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 12 Lab8End


Download ppt "Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab8 Working with Forms Forms Collection Multiple Forms."

Similar presentations


Ads by Google