Your SlideShare is downloading. ×
Introducing User Controls And ManagingComponentsPre-Assessment Questions    •    Consider the following statements:       ...
Introducing User Controls And ManagingComponentsPre-Assessment Questions (Contd.)    •    Consider the following statement...
Introducing User Controls And ManagingComponentsPre-Assessment Questions (Contd.)    1.   The assemblies that are required...
Introducing User Controls And ManagingComponentsPre-Assessment Questions (Contd.)    •    Consider the following statement...
Introducing User Controls And ManagingComponentsSolutions to Pre-AssessmentQuestions         1.   b.         2.   b.      ...
Introducing User Controls And ManagingComponentsObjectives    In this lesson, you will learn to:         • Create customiz...
Introducing User Controls And ManagingComponentsUnderstanding User Controls    •    In Visual Basic .NET, you use controls...
Introducing User Controls And ManagingComponentsUser Controls    •    You can create composite reusable controls and selec...
Introducing User Controls And ManagingComponentsCustomized User Controls    •    While creating a user control the class i...
Introducing User Controls And ManagingComponentsAdding Properties And Functions    •    To add functionalities to a contro...
Introducing User Controls And ManagingComponentsTesting a Control    •    A control is always used in a container.    •   ...
Introducing User Controls And ManagingComponentsCreating Custom Controls from theControl Class    •    To build a control ...
Introducing User Controls And ManagingComponentsInheriting from a User Control    •    User control can be used to build o...
Introducing User Controls And ManagingComponentsRendering Graphical Interface ofCustom Controls    •    To provide a graph...
Introducing User Controls And ManagingComponentsRaising Events    •    To use event handling, you should be able to:      ...
Introducing User Controls And ManagingComponentsDeclaring Events    •    You can declare events within:           • Classe...
Introducing User Controls And ManagingComponentsDelegates    •    In Visual Basic .NET, you use delegates to call event pr...
Introducing User Controls And ManagingComponentsDelegates and AddressOf Operator    •    The AddressOf operator implicitly...
Introducing User Controls And ManagingComponents                   Demo         Creating a User Control ©NIIT     Creating...
Introducing User Controls And ManagingComponentsProblem Statement    •    Build a user Control named ‘MyClock’ that will d...
Introducing User Controls And ManagingComponentsSolution  •      To build and use the ‘MyClock’ user control in an applica...
Introducing User Controls And ManagingComponentsUnderstanding Web Services    •    The evolution of the Internet has resul...
Introducing User Controls And ManagingComponentsIntroduction to Web Services    •    A Web service exposes a number of met...
Introducing User Controls And ManagingComponentsEnabling Technologies used in WebServices    •    Enabling technologies us...
Introducing User Controls And ManagingComponentsAdding and Removing Web referencesfrom a Project    •    A Web Reference c...
Introducing User Controls And ManagingComponentsSummary    In this lesson, you learned that:    •    User controls are vis...
Introducing User Controls And ManagingComponentsSummary (Contd.)    •    A Web service exposes functionality that can be u...
Upcoming SlideShare
Loading in...5
×

Vb.net session 10

351

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
351
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Vb.net session 10"

  1. 1. Introducing User Controls And ManagingComponentsPre-Assessment Questions • 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? d. Both, Statement A and Statement B, are False. e. Both, Statement A and Statement B, are True. f. Statement A is True and Statement B is False. g. Statement A is False and Statement B is True. ©NIIT Creating and Managing components Lesson 1B / Slide 1 of 27
  2. 2. Introducing User Controls And ManagingComponentsPre-Assessment Questions (Contd.) • Consider the following statements: • Statement A. The wrapper that allows interaction between COM and .NET is called RCW. • Statement B. Implementation of component is called ActiveX. Which of the following is correct with respect to the above statements? d. Both, Statement A and Statement B, are False. e. Both, Statement A and Statement B, are True. f. Statement A is True and Statement B is False. g. Statement A is False and Statement B is True ©NIIT Creating and Managing components Lesson 1B / Slide 2 of 27
  3. 3. Introducing User Controls And ManagingComponentsPre-Assessment Questions (Contd.) 1. The assemblies that are required during the execution of an assembly are called: • Metadata • Portable executable • Manifest • Dependencies 3. Using COM+, the business logic can be placed in: • First tier • Middle tier • Third tier • Any tier ©NIIT Creating and Managing components Lesson 1B / Slide 3 of 27
  4. 4. Introducing User Controls And ManagingComponentsPre-Assessment Questions (Contd.) • Consider the following statements: • Statement A. Friend constructor can be used if you want to use a component inside an assembly but not outside it. • Statement B. Private constructor can be used in a component if you want to use it outside the component class. Which of the following is correct with respect to the above statements? d. Both, Statement A and Statement B, are False. e. Both, Statement A and Statement B, are True. f. Statement A is True and Statement B is False. g. Statement A is False and Statement B is True. ©NIIT Creating and Managing components Lesson 1B / Slide 4 of 27
  5. 5. Introducing User Controls And ManagingComponentsSolutions to Pre-AssessmentQuestions 1. b. 2. b. 3. d. Dependencies 4. d. Any tier 5. c. ©NIIT Creating and Managing components Lesson 1B / Slide 5 of 27
  6. 6. Introducing User Controls And ManagingComponentsObjectives 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 ©NIIT Creating and Managing components Lesson 1B / Slide 6 of 27
  7. 7. Introducing User Controls And ManagingComponentsUnderstanding User Controls • In Visual Basic .NET, you use controls such as list boxes, text boxes, menus, check boxes, and buttons to add user interaction capability to the graphical applications. • These controls are visual components that can be used across applications. ©NIIT Creating and Managing components Lesson 1B / Slide 7 of 27
  8. 8. Introducing User Controls And ManagingComponentsUser 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. ©NIIT Creating and Managing components Lesson 1B / Slide 8 of 27
  9. 9. Introducing User Controls And ManagingComponentsCustomized User Controls • While creating a user control the class inherits from the UserControl class by default. • To inherit the user control from another existing control, the Inherits System.Windows.Forms. UserControl statement needs to be changed to the class from which you want to inherit the control. ©NIIT Creating and Managing components Lesson 1B / Slide 9 of 27
  10. 10. Introducing User Controls And ManagingComponentsAdding Properties And Functions • To add functionalities to a control, code has to be added for the property by viewing the code for the control. • The code will consist of the get and set methods of the property. ©NIIT Creating and Managing components Lesson 1B / Slide 10 of 27
  11. 11. Introducing User Controls And ManagingComponentsTesting a Control • A control is always used in a container. • To test a control, you must host it in a Windows Form. ©NIIT Creating and Managing components Lesson 1B / Slide 11 of 27
  12. 12. Introducing User Controls And ManagingComponentsCreating Custom Controls from theControl Class • To build a control from scratch, you can inherit from the Control class. • The Control class defines input from the mouse and the keyboard. • The Control class also defines the bounds and size of controls. ©NIIT Creating and Managing components Lesson 1B / Slide 12 of 27
  13. 13. Introducing User Controls And ManagingComponentsInheriting from a User Control • User control can be used to build other controls. • Parent methods of the base class can be overridden to provide extended functionality in the inherited control. ©NIIT Creating and Managing components Lesson 1B / Slide 13 of 27
  14. 14. Introducing User Controls And ManagingComponentsRendering Graphical Interface ofCustom Controls • To provide a graphical interface to your custom controls you need to override the OnPaint() method of the control class. • The OnPaint() method is executed when a control is first drawn and when a control is resized. ©NIIT Creating and Managing components Lesson 1B / Slide 14 of 27
  15. 15. Introducing User Controls And ManagingComponentsRaising Events • To use event handling, you should be able to: • Declare events. • Raise events. • handle the events raised by your control. ©NIIT Creating and Managing components Lesson 1B / Slide 15 of 27
  16. 16. Introducing User Controls And ManagingComponentsDeclaring 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. ©NIIT Creating and Managing components Lesson 1B / Slide 16 of 27
  17. 17. Introducing User Controls And ManagingComponentsDelegates • 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. ©NIIT Creating and Managing components Lesson 1B / Slide 17 of 27
  18. 18. Introducing User Controls And ManagingComponentsDelegates and AddressOf Operator • The AddressOf operator implicitly creates an instance of a delegate. • Event handlers can be removed dynamically by using the RemoveHandler keyword. ©NIIT Creating and Managing components Lesson 1B / Slide 18 of 27
  19. 19. Introducing User Controls And ManagingComponents Demo Creating a User Control ©NIIT Creating and Managing components Lesson 1B / Slide 19 of 27
  20. 20. Introducing User Controls And ManagingComponentsProblem 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. ©NIIT Creating and Managing components Lesson 1B / Slide 20 of 27
  21. 21. Introducing User Controls And ManagingComponentsSolution • 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. ©NIIT Creating and Managing components Lesson 1B / Slide 21 of 27
  22. 22. Introducing User Controls And ManagingComponentsUnderstanding Web Services • The evolution of the Internet has resulted in a gradual shift from desktop to distributed applications. • The development of distributed applications involves ensuring that components hosted in heterogeneous environments are interoperable. • To address these issues, Web Services have been introduced. ©NIIT Creating and Managing components Lesson 1B / Slide 22 of 27
  23. 23. Introducing User Controls And ManagingComponentsIntroduction to Web Services • A Web service exposes a number of methods that provide 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 methods that provide such functionality are called Web methods. • An application that uses a Web service is called a Web service client. ©NIIT Creating and Managing components Lesson 1B / Slide 23 of 27
  24. 24. Introducing User Controls And ManagingComponentsEnabling Technologies used in WebServices • Enabling technologies used in Web Services are: • XML • XML is a plain-text format that can be understood by any platform. • SOAP • SOAP is a standard communication protocol for interchanging information in a structured format in a distributed environment. • WSDL • WSDL is a markup language that describes a Web service. • UDDI • UDDI provides a standard mechanism to register and discover a Web service. ©NIIT Creating and Managing components Lesson 1B / Slide 24 of 27
  25. 25. Introducing User Controls And ManagingComponentsAdding and Removing Web referencesfrom a Project • A Web Reference can be added and removed by using Solution Explorer. • A Web Service can be called programmatically. ©NIIT Creating and Managing components Lesson 1B / Slide 25 of 27
  26. 26. Introducing User Controls And ManagingComponentsSummary In this lesson, you learned that: • User controls are visual components. • You can create a reusable unit of controls and selectively expose their properties by inheriting from the UserControl class. • You can create a customized user control by inheriting from an existing control. • You can override the OnPaint() method to customize the drawing of a control. • You can declare, raise, and handle events. • Delegates are objects that you use to call the methods of other objects. ©NIIT Creating and Managing components Lesson 1B / Slide 26 of 27
  27. 27. Introducing User Controls And ManagingComponentsSummary (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

×