Académique Documents
Professionnel Documents
Culture Documents
Components
Pre-Assessment Questions
1. Consider the following statements:
• Statement A: Timer is an in-built component.
• Statement B: ServiceController is an in-built components.
Which of the following is correct with respect to the above statements?
a. Both, Statement A and Statement B, are False.
b. Both, Statement A and Statement B, are True.
c. Statement A is True and Statement B is False.
d. Statement A is False and Statement B is True.
Solutions to Pre-Assessment
Questions
1. b.
2. b.
3. d. Dependencies
4. d. Any tier
5. c.
Objectives
In this lesson, you will learn to:
• Create customized user controls
• Add existing components and controls to a user control
• Declare and raise events in a user control
• Create a user control
• Identify the need for Web services
• Identify the enabling technologies in Web services
• Add and remove Web references
User Controls
• You can create composite reusable controls and selectively expose the
properties of these controls.
• The UserControl class can be used to combine the functionality of different
controls into one unit that can be reused.
• The UserControl class can contain multiple child controls.
• The UserControl class presents a single and unified interface.
Testing a Control
• A control is always used in a container.
• To test a control, you must host it in a Windows Form.
Raising Events
• To use event handling, you should be able to:
• Declare events.
• Raise events.
• handle the events raised by your control.
Declaring Events
• You can declare events within:
• Classes.
• Structures.
• Interfaces.
• To declare an event, you need to use the Event keyword.
• In Visual Basic .NET, you need to use the RaiseEvent keyword to raise an
event.
• Any object capable of raising an event is an event sender.
• Event handlers are special types of procedures that are called when an event
occurs.
Delegates
• In Visual Basic .NET, you use delegates to call event procedures.
• Delegates are objects that you use to call the methods of other objects.
• Delegates in Visual Basic .NET can reference both shared and instance
methods.
Demo
Creating a User Control
Problem Statement
• Build a user Control named ‘MyClock’ that will display the current time and
will also perform the function of an alarm. Test this user control in a VB.NET
application.
Solution
• To build and use the ‘MyClock’ user control in an application, you need to
perform the following steps:
1. Create the User Control.
2. Add Windows Controls to the User Controls.
3. Create the Inherited Control.
4. Add Properties to the User Control.
5. Test the User Control.
Summary
In this lesson, you learned that:
Summary (Contd.)
• A Web service exposes functionality that can be used by one or more
applications, regardless of the programming languages, operating systems,
and hardware platforms used to develop them.
• The functionality exposed by a Web service can be accessed by applications
by using Internet standards, such as HyperText Transfer Protocol (HTTP) and
eXtensible Markup Language (XML).
• To be able to communicate with each other, a Web service and a client
application must agree upon a common protocol. SOAP is a standard
communications protocol for interchanging information in a structured format
in a distributed environment.
• To be able to use a Web service, the developers of a client application need
to know the methods exposed by the Web service and the parameters to be
passed to these methods. Web Services Description Language (WSDL) is a
markup language, which is used to describe a Web service.
• The Universal Description Discovery and Integration (UDDI) initiative is used
to allow client applications to discover the Web services provided by various
Web service providers.
©NIIT Creating and Managing components Lesson 1B / Slide 27 of 27