SlideShare a Scribd company logo
GUI Applications Development Using .NET Framework
Objectives


                In this session, you will learn to:
                   Work with user-defined components in the .NET applications




     Ver. 1.0                        Session 11                        Slide 1 of 20
GUI Applications Development Using .NET Framework
Creating a .NET Component


                To create a component in .NET, the user needs to identify
                the type of component and its properties and methods.
                While creating a component, a user needs to:
                   Use constructors
                   Add properties
                   Add methods




     Ver. 1.0                         Session 11                    Slide 2 of 20
GUI Applications Development Using .NET Framework
Creating a .NET Component (Contd.)


                Using Constructors:
                   .NET allows the passing of arguments to the object constructor
                   by adding a constructor to the component's class module.
                   A component can have the following types of constructors:
                      Public constructors
                      Internal constructors
                      Private constructors




     Ver. 1.0                        Session 11                          Slide 3 of 20
GUI Applications Development Using .NET Framework
Creating a .NET Component (Contd.)


                Adding Properties:
                – Declaring a property allows you to control how a value is
                  changed or read.
                – You can declare a private variable that cannot be accessed
                  from outside a class.
                – You can create a property where you can have the Get and
                  Set accessors to read and set the value of a private variable.




     Ver. 1.0                        Session 11                          Slide 4 of 20
GUI Applications Development Using .NET Framework
Creating a .NET Component (Contd.)


                Adding Methods:
                   A method in a class can be:
                      a procedure that performs an operation on the data within the
                      class.
                      a function that performs some operation on the data and returns
                      the data from the class.
                   The method must be declared public to call a method from an
                   instance of this class.
                   If a method is declared private, only methods within the same
                   class can call that method.




     Ver. 1.0                        Session 11                               Slide 5 of 20
GUI Applications Development Using .NET Framework
Just a minute


                Name the two main categories of .NET components.




                Answer:
                1. In-process components
                2. Out-of-process components

     Ver. 1.0                     Session 11                       Slide 6 of 20
GUI Applications Development Using .NET Framework
Creating User-Defined Controls in .NET Applications


                There may be situations when you require a control, which
                performs actions that are not provided by any built-in control
                or need some enhanced feature.
                The .NET Framework provides three types of user-defined
                controls. These are:
                   User control
                   Controls inherited from an existing control
                   Custom control




     Ver. 1.0                        Session 11                       Slide 7 of 20
GUI Applications Development Using .NET Framework
Creating User-Defined Controls in .NET Applications (Contd.)


                User Controls:
                – You combine two or more controls to create a new control.
                – User controls are also called as composite controls.
                – All user controls inherit the
                  System.Windows.Forms.UserControl class.
                – The UserControl class can be used to combine the
                  functionality of various controls into one unit, which can be
                  reused.
                – The UserControl class presents a single and unified
                  interface.
                – This interface contains members inherited from the control
                  classes.




     Ver. 1.0                        Session 11                            Slide 8 of 20
GUI Applications Development Using .NET Framework
Creating User-Defined Controls in .NET Applications (Contd.)


                Controls Inherited from an Existing Control:
                   You can inherit from an existing control and then add
                   additional features to it.
                   When you inherit a control from an existing control, the new
                   control will have all the features of the inherited control.




     Ver. 1.0                       Session 11                            Slide 9 of 20
GUI Applications Development Using .NET Framework
Just a minute


                Name the method that has to be overridden to change the
                appearance of the control that is inherited from an existing
                control.




                Answer:
                 – The OnPaint() method


     Ver. 1.0                      Session 11                         Slide 10 of 20
GUI Applications Development Using .NET Framework
Creating User-Defined Controls in .NET Applications (Contd.)


                Custom Controls:
                – Custom controls have the highest degree of customizability.
                – Users can build a control that has very little resemblance with
                  the built-in controls in terms of both appearance and
                  functionality.
                – All custom controls inherit from the
                  System.Windows.Forms.Control class.




     Ver. 1.0                       Session 11                            Slide 11 of 20
GUI Applications Development Using .NET Framework
Just a minute


                Name the class to be inherited for creating a custom
                control.




                Answer:
                   System.Windows.Forms.Control


     Ver. 1.0                      Session 11                          Slide 12 of 20
GUI Applications Development Using .NET Framework
Demo: Implementing a .NET Component


               Problem Statement:
                  Build a nonvisual .NET component called TimeComponent. It
                  should get the current date and time from the host computer. In
                  addition, create an application that will use this component and
                  display the time returned.




    Ver. 1.0                       Session 11                            Slide 13 of 20
GUI Applications Development Using .NET Framework
Demo: Implementing a .NET Component (Contd.)


               Solution:
                  To use a component, you need to perform the following tasks:
                    1. Create a .NET component.
                    2. Create a user application.




    Ver. 1.0                         Session 11                        Slide 14 of 20
GUI Applications Development Using .NET Framework
Demo: Creating a User Control


                Problem Statement:
                   Build a user control called DigitalClock. This should contain a
                   label control that displays time. In addition, create an
                   application that will use this control.




     Ver. 1.0                        Session 11                            Slide 15 of 20
GUI Applications Development Using .NET Framework
Demo: Creating a User Control (Contd.)


                Solution:
                   To build a user control and an application, you need to perform
                   the following tasks:
                     1. Create a user control.
                     2. Create a user application.




     Ver. 1.0                         Session 11                         Slide 16 of 20
GUI Applications Development Using .NET Framework
Demo: Creating Inherited Controls


                Problem Statement:
                   Build a NumericTextBox control that contains a TextBox
                   control. The latter should accept only a numeric value as input.
                   In addition, create an application that will use this control.




     Ver. 1.0                       Session 11                            Slide 17 of 20
GUI Applications Development Using .NET Framework
Demo: Creating Inherited Controls (Contd.)


                Solution:
                   To create the NumericTextBox control and an application,
                   which will implement the NumericTextBox control, you need to
                   perform the following tasks:
                     1. Create an inherited control.
                     2. Create a user application.




     Ver. 1.0                          Session 11                      Slide 18 of 20
GUI Applications Development Using .NET Framework
Summary


               In this session, you learned that:
                  To create a component in .NET, the user needs to identify the
                  type of component and its properties and methods.
                  While creating a component, a user needs to:
                    •   Use constructors
                    •   Add properties
                    •   Add methods
                  In .NET programming environment, you can have the following
                  types of constructors:
                        Public constructor
                        Internal constructor
                        Private constructor




    Ver. 1.0                           Session 11                       Slide 19 of 20
GUI Applications Development Using .NET Framework
Summary (Contd.)


               The .NET Framework provides three types of user-defined
               controls. These are:
                   User controls
                   Controls inherited from an existing control
                   Custom controls




    Ver. 1.0                      Session 11                      Slide 20 of 20

More Related Content

Viewers also liked

09 gui 13
09 gui 1309 gui 13
09 gui 13
Niit Care
 
04 gui 05
04 gui 0504 gui 05
04 gui 05
Niit Care
 
02 gui 02
02 gui 0202 gui 02
02 gui 02
Niit Care
 
10 gui 14
10 gui 1410 gui 14
10 gui 14
Niit Care
 
01 gui 01
01 gui 0101 gui 01
01 gui 01
Niit Care
 
02 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_0202 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_02
Niit Care
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
Siraj Memon
 

Viewers also liked (7)

09 gui 13
09 gui 1309 gui 13
09 gui 13
 
04 gui 05
04 gui 0504 gui 05
04 gui 05
 
02 gui 02
02 gui 0202 gui 02
02 gui 02
 
10 gui 14
10 gui 1410 gui 14
10 gui 14
 
01 gui 01
01 gui 0101 gui 01
01 gui 01
 
02 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_0202 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_02
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
 

Similar to 08 gui 11

Vb.net session 10
Vb.net session 10Vb.net session 10
Vb.net session 10
Niit Care
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
Prashanth Shivakumar
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
Niit Care
 
Vb.net session 09
Vb.net session 09Vb.net session 09
Vb.net session 09
Niit Care
 
06 gui 08
06 gui 0806 gui 08
06 gui 08
Niit Care
 
GUI design using JAVAFX.ppt
GUI design using JAVAFX.pptGUI design using JAVAFX.ppt
GUI design using JAVAFX.ppt
TabassumMaktum
 
Custom Widgets Tutorial InTouch Machine Edition (ITME)
Custom Widgets Tutorial InTouch Machine Edition (ITME)Custom Widgets Tutorial InTouch Machine Edition (ITME)
Custom Widgets Tutorial InTouch Machine Edition (ITME)
Wonderware InTouch Machine Edition
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
Niit Care
 
UIAutomator
UIAutomatorUIAutomator
UIAutomator
Sandip Ganguli
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
Vivek chan
 
Unit Testing Using Mockito in Android (1).pdf
Unit Testing Using Mockito in Android (1).pdfUnit Testing Using Mockito in Android (1).pdf
Unit Testing Using Mockito in Android (1).pdf
Katy Slemon
 
Vb.net session 02
Vb.net session 02Vb.net session 02
Vb.net session 02
Niit Care
 
Vb net xp_14
Vb net xp_14Vb net xp_14
Vb net xp_14
Niit Care
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
Vivek chan
 
Building richwebapplicationsusingasp
Building richwebapplicationsusingaspBuilding richwebapplicationsusingasp
Building richwebapplicationsusingasp
Giovanni Javier Jimenez Cadena
 
Vb net xp_13
Vb net xp_13Vb net xp_13
Vb net xp_13
Niit Care
 
Vb net xp_16
Vb net xp_16Vb net xp_16
Vb net xp_16
Niit Care
 
My Very First Zf App Part One
My Very First Zf App   Part OneMy Very First Zf App   Part One
My Very First Zf App Part One
isaaczfoster
 
Moving to Microsoft Visual Basic .NET
Moving to Microsoft Visual Basic .NETMoving to Microsoft Visual Basic .NET
Moving to Microsoft Visual Basic .NET
V Sanchez
 
Building DotNetNuke Modules
Building DotNetNuke ModulesBuilding DotNetNuke Modules
Building DotNetNuke Modules
Engage Software
 

Similar to 08 gui 11 (20)

Vb.net session 10
Vb.net session 10Vb.net session 10
Vb.net session 10
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
 
Vb.net session 09
Vb.net session 09Vb.net session 09
Vb.net session 09
 
06 gui 08
06 gui 0806 gui 08
06 gui 08
 
GUI design using JAVAFX.ppt
GUI design using JAVAFX.pptGUI design using JAVAFX.ppt
GUI design using JAVAFX.ppt
 
Custom Widgets Tutorial InTouch Machine Edition (ITME)
Custom Widgets Tutorial InTouch Machine Edition (ITME)Custom Widgets Tutorial InTouch Machine Edition (ITME)
Custom Widgets Tutorial InTouch Machine Edition (ITME)
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
UIAutomator
UIAutomatorUIAutomator
UIAutomator
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
 
Unit Testing Using Mockito in Android (1).pdf
Unit Testing Using Mockito in Android (1).pdfUnit Testing Using Mockito in Android (1).pdf
Unit Testing Using Mockito in Android (1).pdf
 
Vb.net session 02
Vb.net session 02Vb.net session 02
Vb.net session 02
 
Vb net xp_14
Vb net xp_14Vb net xp_14
Vb net xp_14
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
 
Building richwebapplicationsusingasp
Building richwebapplicationsusingaspBuilding richwebapplicationsusingasp
Building richwebapplicationsusingasp
 
Vb net xp_13
Vb net xp_13Vb net xp_13
Vb net xp_13
 
Vb net xp_16
Vb net xp_16Vb net xp_16
Vb net xp_16
 
My Very First Zf App Part One
My Very First Zf App   Part OneMy Very First Zf App   Part One
My Very First Zf App Part One
 
Moving to Microsoft Visual Basic .NET
Moving to Microsoft Visual Basic .NETMoving to Microsoft Visual Basic .NET
Moving to Microsoft Visual Basic .NET
 
Building DotNetNuke Modules
Building DotNetNuke ModulesBuilding DotNetNuke Modules
Building DotNetNuke Modules
 

More from Niit Care

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
Niit Care
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
Niit Care
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
Niit Care
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
Niit Care
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
Niit Care
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
Niit Care
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
Niit Care
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
Niit Care
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
Niit Care
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
Niit Care
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
Niit Care
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
Niit Care
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
Niit Care
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
Niit Care
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
Niit Care
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
Niit Care
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
Niit Care
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
Niit Care
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
Niit Care
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
Niit Care
 

More from Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Recently uploaded

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 

Recently uploaded (20)

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 

08 gui 11

  • 1. GUI Applications Development Using .NET Framework Objectives In this session, you will learn to: Work with user-defined components in the .NET applications Ver. 1.0 Session 11 Slide 1 of 20
  • 2. GUI Applications Development Using .NET Framework Creating a .NET Component To create a component in .NET, the user needs to identify the type of component and its properties and methods. While creating a component, a user needs to: Use constructors Add properties Add methods Ver. 1.0 Session 11 Slide 2 of 20
  • 3. GUI Applications Development Using .NET Framework Creating a .NET Component (Contd.) Using Constructors: .NET allows the passing of arguments to the object constructor by adding a constructor to the component's class module. A component can have the following types of constructors: Public constructors Internal constructors Private constructors Ver. 1.0 Session 11 Slide 3 of 20
  • 4. GUI Applications Development Using .NET Framework Creating a .NET Component (Contd.) Adding Properties: – Declaring a property allows you to control how a value is changed or read. – You can declare a private variable that cannot be accessed from outside a class. – You can create a property where you can have the Get and Set accessors to read and set the value of a private variable. Ver. 1.0 Session 11 Slide 4 of 20
  • 5. GUI Applications Development Using .NET Framework Creating a .NET Component (Contd.) Adding Methods: A method in a class can be: a procedure that performs an operation on the data within the class. a function that performs some operation on the data and returns the data from the class. The method must be declared public to call a method from an instance of this class. If a method is declared private, only methods within the same class can call that method. Ver. 1.0 Session 11 Slide 5 of 20
  • 6. GUI Applications Development Using .NET Framework Just a minute Name the two main categories of .NET components. Answer: 1. In-process components 2. Out-of-process components Ver. 1.0 Session 11 Slide 6 of 20
  • 7. GUI Applications Development Using .NET Framework Creating User-Defined Controls in .NET Applications There may be situations when you require a control, which performs actions that are not provided by any built-in control or need some enhanced feature. The .NET Framework provides three types of user-defined controls. These are: User control Controls inherited from an existing control Custom control Ver. 1.0 Session 11 Slide 7 of 20
  • 8. GUI Applications Development Using .NET Framework Creating User-Defined Controls in .NET Applications (Contd.) User Controls: – You combine two or more controls to create a new control. – User controls are also called as composite controls. – All user controls inherit the System.Windows.Forms.UserControl class. – The UserControl class can be used to combine the functionality of various controls into one unit, which can be reused. – The UserControl class presents a single and unified interface. – This interface contains members inherited from the control classes. Ver. 1.0 Session 11 Slide 8 of 20
  • 9. GUI Applications Development Using .NET Framework Creating User-Defined Controls in .NET Applications (Contd.) Controls Inherited from an Existing Control: You can inherit from an existing control and then add additional features to it. When you inherit a control from an existing control, the new control will have all the features of the inherited control. Ver. 1.0 Session 11 Slide 9 of 20
  • 10. GUI Applications Development Using .NET Framework Just a minute Name the method that has to be overridden to change the appearance of the control that is inherited from an existing control. Answer: – The OnPaint() method Ver. 1.0 Session 11 Slide 10 of 20
  • 11. GUI Applications Development Using .NET Framework Creating User-Defined Controls in .NET Applications (Contd.) Custom Controls: – Custom controls have the highest degree of customizability. – Users can build a control that has very little resemblance with the built-in controls in terms of both appearance and functionality. – All custom controls inherit from the System.Windows.Forms.Control class. Ver. 1.0 Session 11 Slide 11 of 20
  • 12. GUI Applications Development Using .NET Framework Just a minute Name the class to be inherited for creating a custom control. Answer: System.Windows.Forms.Control Ver. 1.0 Session 11 Slide 12 of 20
  • 13. GUI Applications Development Using .NET Framework Demo: Implementing a .NET Component Problem Statement: Build a nonvisual .NET component called TimeComponent. It should get the current date and time from the host computer. In addition, create an application that will use this component and display the time returned. Ver. 1.0 Session 11 Slide 13 of 20
  • 14. GUI Applications Development Using .NET Framework Demo: Implementing a .NET Component (Contd.) Solution: To use a component, you need to perform the following tasks: 1. Create a .NET component. 2. Create a user application. Ver. 1.0 Session 11 Slide 14 of 20
  • 15. GUI Applications Development Using .NET Framework Demo: Creating a User Control Problem Statement: Build a user control called DigitalClock. This should contain a label control that displays time. In addition, create an application that will use this control. Ver. 1.0 Session 11 Slide 15 of 20
  • 16. GUI Applications Development Using .NET Framework Demo: Creating a User Control (Contd.) Solution: To build a user control and an application, you need to perform the following tasks: 1. Create a user control. 2. Create a user application. Ver. 1.0 Session 11 Slide 16 of 20
  • 17. GUI Applications Development Using .NET Framework Demo: Creating Inherited Controls Problem Statement: Build a NumericTextBox control that contains a TextBox control. The latter should accept only a numeric value as input. In addition, create an application that will use this control. Ver. 1.0 Session 11 Slide 17 of 20
  • 18. GUI Applications Development Using .NET Framework Demo: Creating Inherited Controls (Contd.) Solution: To create the NumericTextBox control and an application, which will implement the NumericTextBox control, you need to perform the following tasks: 1. Create an inherited control. 2. Create a user application. Ver. 1.0 Session 11 Slide 18 of 20
  • 19. GUI Applications Development Using .NET Framework Summary In this session, you learned that: To create a component in .NET, the user needs to identify the type of component and its properties and methods. While creating a component, a user needs to: • Use constructors • Add properties • Add methods In .NET programming environment, you can have the following types of constructors: Public constructor Internal constructor Private constructor Ver. 1.0 Session 11 Slide 19 of 20
  • 20. GUI Applications Development Using .NET Framework Summary (Contd.) The .NET Framework provides three types of user-defined controls. These are: User controls Controls inherited from an existing control Custom controls Ver. 1.0 Session 11 Slide 20 of 20

Editor's Notes

  1. Start the session by sharing the session objectives with the students.
  2. Using this slide, the faculty must discuss with the students that they can create components in .NET. These components may comprise of constructors to initialize data members. In addition, it can include set and get methods to initialize properties and methods to perform some specific tasks.
  3. Using this slide, the faculty must discuss with the students the three types of constructor that a .NET component can have.
  4. Using this slide, the faculty must discuss with the students the way of adding properties to a .NET component. The faculty should discuss the purpose of Set and Get methods in modifying the value of properties.
  5. Using this slide, the faculty must discuss that methods can be created within components. These methods are normal functions to perform a particular task that may or may not return a value. The faculty should also discuss the access specifiers that can be used with the methods and the effect of using these access specifiers.
  6. Reiterate the concepts taught earlier by asking the given question.
  7. Use this slide to discuss that it is possible to create three different types of controls in .NET. These have been listed in the slide. The faculty can give an example to make the students understand these in a better way. User Control: You combine two or more controls to create a new control. The new control will act like a single control. User controls are also called as composite controls . For example, a control is created using a form and a text box to connect to a database. Inheriting form an existing control: You may require some additional function to be added to an existing control. You can inherit from an existing control and then add the required features to it. The faculty can use the same example of a numeric text box. Custom Control: Custom controls have the highest degree of customizability. You may require a control that has very little resemblance with the built-in controls in terms of both appearance and functionality. The faculty can explain the example from the SG - if you need an analog clock control, combining controls or inheriting a control will be of very little help. You will have to create the control from scratch. The following four slides discuss these in detail.
  8. Use this slide to discuss the steps for creating user control. It will be a good teaching practice to demonstrate this with the help of a small example.
  9. Reiterate the concepts taught earlier by asking the given question.
  10. Reiterate the concepts taught earlier by asking the given question.
  11. Conduct the activity stated in the slide in a collaborative mode in the class.
  12. Conduct the activity stated in the slide in a collaborative mode in the class.
  13. Conduct the activity stated in the slide in a collaborative mode in the class.
  14. Conduct the activity stated in the slide in a collaborative mode in the class.
  15. Conduct the activity stated in the slide in a collaborative mode in the class.
  16. Conduct the activity stated in the slide in a collaborative mode in the class.
  17. You can summarize the session by using the summary given in the slides. In addition, you can also ask students summarize what they have learnt in this session.
  18. You can summarize the session by using the summary given in the slides. In addition, you can also ask students summarize what they have learnt in this session.