chap11 - Chapter 11 Using Multiple Forms with Problem...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Object-Oriented Application Development Using VB .NET 1 Chapter 11 Using Multiple Forms with Problem Domain Classes
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 2 Objectives In this chapter, you will: Develop a GUI class that interacts with a PD class Simulate interaction with a database Develop a GUI class that interacts with multiple PD classes Navigate multiple forms in an integrated system Develop a GUI class that navigates a PD association relationship
Background image of page 2
Object-Oriented Application Development Using VB .NET 3 Developing a GUI Class that Interacts with a PD Class AddCustomer A GUI class Used to Input customer attribute values Create instances of the Customer class
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 4 Developing a GUI Class that Interacts with a PD Class GUI form for adding a new customer contains: A label For the Bradshaw Marina logo Three text boxes txtName: to input customer name txtAddress: to input customer address txtPhone : to input customer phone number Three labels To identify the text boxes
Background image of page 4
Object-Oriented Application Development Using VB .NET 5 Developing a GUI Class that Interacts with a PD Class GUI form for adding a new customer contains (Continued) Three buttons btnAdd: adds a new customer after the data has been entered btnClear: clears the text boxes btnClose: closes the form and terminates processing
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 6 Adding Variables to the Generated Code Variables needed to respond to events Not generated by the visual programming process Must be added to the source code through the Code Editor window Often declared with class scope
Background image of page 6
Object-Oriented Application Development Using VB .NET 7 Adding Variables to the Generated Code Variables needed for this example A Customer reference To create a new Customer instance from the data entered by the user Three String variables To contain the customer data that is retrieved from the text boxes
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 8 Handling Events Push buttons on the form btnAdd_Click Event: add a customer btnClear_Click Event: clear the form btnClose_Click Event: close the form Event handling methods btnAdd.Click btnClear.Click btnClose.Click
Background image of page 8
Object-Oriented Application Development Using VB .NET 9 Handling Events btnClear_Click method Calls the ClearForm method, which Stores an empty string in each of the text boxes Invokes the Focus method for the txtName control Focus method » Positions the cursor within the Name text box » Sets the input focus to this control btnClose_Click method Closes the form
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Application Development Using VB .NET 10 Handling Events btnAdd_Click method Retrieves the data from the text boxes Validates values for name, address, and phone If any of the values are missing, a message box
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/07/2008 for the course CSC 208 taught by Professor Walker during the Spring '06 term at Monroe CC.

Page1 / 47

chap11 - Chapter 11 Using Multiple Forms with Problem...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online