SlideShare a Scribd company logo
1 of 17
Visual
Programming
MS SANA IFTIKHAR
Dialog
Windows control
Common control
IT
GDI
It enables applications to use graphics
It do not access the graphics hardware directly interacts with device drivers More or less
obsolete (Direct2D)
Dialog box
Much of the behind-the-scenes work, such as closing and destroying the dialog window, is handled
automatically with modal dialog boxes.
With modeless dialog boxes, however, especially in dialog-based applications, you need to override
several inherited member functions.
Overriding the inherited member functions allows you to correctly close and destroy the dialog
window.
All dialog boxes—whether standard or custom—are created using two components: a dialog resource
and a dialog class derived from the CDialog class.
The dialog resource represents the visual aspect of the dialog box, and the dialog class provides
programmatic access to the dialog box.
Modal
Modal dialog boxes require users to close or cancel the dialog box before they can continue
working with an application.
Once a modal message box appears on your screen, you cannot access any other window
in an application until you close the message box.
Modeless
In comparison to a modal dialog box, modeless dialog boxes do not need to be closed
before you return to another window in the application.
Modeless dialog boxes function more like frame windows and other types of primary
application windows.
Modeless dialog boxes require quite a bit more work than modal dialog boxes.
Displaying Modal Dialog Boxes
You display a modal dialog box from an application’s InitInstance() function, the same way you display
a frame window. You instantiate an object of the dialog class and use the inherited DoModal()
function to display the modal dialog box. By default, if a user clicks a button containing a resource ID
of IDOK or IDCANCEL, the dialog box closes.
The IDOK resource ID represents the OK button, and the IDCANCEL resource ID represents the Cancel
button. The DoModal() function returns an integer value representing the resource ID that caused the
dialog box to close. You use these resource IDs in an if statement to take the appropriate action,
depending on whether the user pressed the OK button or the Cancel button.
Displaying Modeless Dialog
Boxes
Construct using the resource editor in the same way as a modal dialog.
Launch it by calling CDialog::Create().instead of CDialog::DoModal()
Dismiss it by calling CWnd::DestroyWindow().
instead of CDialog::EndDialog().you must NEVER call EndDialog() for a modeless dialog.
you MUST override OnCancel() in order to prevent it from calling EndDialog().
Working with Controls
Dialog boxes typically contain groups of controls through which a user interacts with an
application.
Controls are user interface items such check boxes, command buttons, text boxes, and other
objects.
You add controls to a dialog box by using the Controls toolbar in the Dialog Editor.
MFC
Controls are the user interface objects used to create interfaces for Windows applications.
Most Windows applications are nothing but a collection of controls arranged in a way that
appropriately implements the functionality of the program.
There are only six basic controls - CStatic, CButton, CListBox, CComboBox, CEdit, and CScrollBar -
along with some minor variations (Windows added a collection of about 15 enhanced controls as
well).
Controls
The Resource Editor makes it easy to add controls to dialog boxes.
The controls are automatically created when the dialog is created.
The Class Wizard makes it easy to link these controls to dialog class member functions or member
variables.
Controls
Controls are actually Windows Controls are Child Windows
They have their own window procedures (provided by Windows).
In MFC, they inherit all the CWnd functionality.Controls are Child Windowsclipped to parent, move
with parent, destroyed with parent.when using VC++ Resource Editor - parent is usually a dialog class
derived from CDialog.send WM_COMMAND notifications to parent.
Visual programming is a type of programming
Visual programming is a type of programming
Visual programming is a type of programming
Visual programming is a type of programming

More Related Content

Similar to Visual programming is a type of programming

Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop AppFajar Baskoro
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginnerSalim M
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic conceptsmelody77776
 
Creating simple component
Creating simple componentCreating simple component
Creating simple componentpriya Nithya
 
01csharp - visual studio environment.pptx
01csharp - visual studio environment.pptx01csharp - visual studio environment.pptx
01csharp - visual studio environment.pptxRobeliaJoyVillaruz
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxAOmaAli
 
Unit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUnit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUjwala Junghare
 
Csc153 chapter 03
Csc153 chapter 03Csc153 chapter 03
Csc153 chapter 03PCC
 
Android basics – dialogs and floating activities
Android basics – dialogs and floating activitiesAndroid basics – dialogs and floating activities
Android basics – dialogs and floating activitiesinfo_zybotech
 
06 win forms
06 win forms06 win forms
06 win formsmrjw
 

Similar to Visual programming is a type of programming (20)

Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop App
 
Vb lecture
Vb lectureVb lecture
Vb lecture
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic concepts
 
UNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdfUNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdf
 
Creating simple component
Creating simple componentCreating simple component
Creating simple component
 
Meaning Of VB
Meaning Of VBMeaning Of VB
Meaning Of VB
 
01csharp - visual studio environment.pptx
01csharp - visual studio environment.pptx01csharp - visual studio environment.pptx
01csharp - visual studio environment.pptx
 
Vb basics
Vb basicsVb basics
Vb basics
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptx
 
unit 4.docx
unit 4.docxunit 4.docx
unit 4.docx
 
04 gui 05
04 gui 0504 gui 05
04 gui 05
 
Unit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUnit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdf
 
21 -windows
21  -windows21  -windows
21 -windows
 
Vc++ 2
Vc++ 2Vc++ 2
Vc++ 2
 
Csc153 chapter 03
Csc153 chapter 03Csc153 chapter 03
Csc153 chapter 03
 
Visual programming
Visual programmingVisual programming
Visual programming
 
Android basics – dialogs and floating activities
Android basics – dialogs and floating activitiesAndroid basics – dialogs and floating activities
Android basics – dialogs and floating activities
 
06 win forms
06 win forms06 win forms
06 win forms
 

More from sanaiftikhar23

Object Oriented Programming Language is an oop
Object Oriented Programming Language is an oopObject Oriented Programming Language is an oop
Object Oriented Programming Language is an oopsanaiftikhar23
 
MobApp 07 componentof screen layout.pptx
MobApp 07 componentof screen layout.pptxMobApp 07 componentof screen layout.pptx
MobApp 07 componentof screen layout.pptxsanaiftikhar23
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxsanaiftikhar23
 
MobApp development 01 application platform.pptx
MobApp development 01 application platform.pptxMobApp development 01 application platform.pptx
MobApp development 01 application platform.pptxsanaiftikhar23
 
L21-Introduction-to-IO.ppt
L21-Introduction-to-IO.pptL21-Introduction-to-IO.ppt
L21-Introduction-to-IO.pptsanaiftikhar23
 
fundamentals-of-algorithm-2nd-lec-170418023540.pdf
fundamentals-of-algorithm-2nd-lec-170418023540.pdffundamentals-of-algorithm-2nd-lec-170418023540.pdf
fundamentals-of-algorithm-2nd-lec-170418023540.pdfsanaiftikhar23
 

More from sanaiftikhar23 (7)

Object Oriented Programming Language is an oop
Object Oriented Programming Language is an oopObject Oriented Programming Language is an oop
Object Oriented Programming Language is an oop
 
MobApp 07 componentof screen layout.pptx
MobApp 07 componentof screen layout.pptxMobApp 07 componentof screen layout.pptx
MobApp 07 componentof screen layout.pptx
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptx
 
MobApp development 01 application platform.pptx
MobApp development 01 application platform.pptxMobApp development 01 application platform.pptx
MobApp development 01 application platform.pptx
 
L21-Introduction-to-IO.ppt
L21-Introduction-to-IO.pptL21-Introduction-to-IO.ppt
L21-Introduction-to-IO.ppt
 
fundamentals-of-algorithm-2nd-lec-170418023540.pdf
fundamentals-of-algorithm-2nd-lec-170418023540.pdffundamentals-of-algorithm-2nd-lec-170418023540.pdf
fundamentals-of-algorithm-2nd-lec-170418023540.pdf
 
templates.pptx
templates.pptxtemplates.pptx
templates.pptx
 

Recently uploaded

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

Visual programming is a type of programming

  • 3. GDI It enables applications to use graphics It do not access the graphics hardware directly interacts with device drivers More or less obsolete (Direct2D)
  • 4. Dialog box Much of the behind-the-scenes work, such as closing and destroying the dialog window, is handled automatically with modal dialog boxes. With modeless dialog boxes, however, especially in dialog-based applications, you need to override several inherited member functions. Overriding the inherited member functions allows you to correctly close and destroy the dialog window. All dialog boxes—whether standard or custom—are created using two components: a dialog resource and a dialog class derived from the CDialog class. The dialog resource represents the visual aspect of the dialog box, and the dialog class provides programmatic access to the dialog box.
  • 5. Modal Modal dialog boxes require users to close or cancel the dialog box before they can continue working with an application. Once a modal message box appears on your screen, you cannot access any other window in an application until you close the message box.
  • 6. Modeless In comparison to a modal dialog box, modeless dialog boxes do not need to be closed before you return to another window in the application. Modeless dialog boxes function more like frame windows and other types of primary application windows. Modeless dialog boxes require quite a bit more work than modal dialog boxes.
  • 7. Displaying Modal Dialog Boxes You display a modal dialog box from an application’s InitInstance() function, the same way you display a frame window. You instantiate an object of the dialog class and use the inherited DoModal() function to display the modal dialog box. By default, if a user clicks a button containing a resource ID of IDOK or IDCANCEL, the dialog box closes. The IDOK resource ID represents the OK button, and the IDCANCEL resource ID represents the Cancel button. The DoModal() function returns an integer value representing the resource ID that caused the dialog box to close. You use these resource IDs in an if statement to take the appropriate action, depending on whether the user pressed the OK button or the Cancel button.
  • 8. Displaying Modeless Dialog Boxes Construct using the resource editor in the same way as a modal dialog. Launch it by calling CDialog::Create().instead of CDialog::DoModal() Dismiss it by calling CWnd::DestroyWindow(). instead of CDialog::EndDialog().you must NEVER call EndDialog() for a modeless dialog. you MUST override OnCancel() in order to prevent it from calling EndDialog().
  • 9. Working with Controls Dialog boxes typically contain groups of controls through which a user interacts with an application. Controls are user interface items such check boxes, command buttons, text boxes, and other objects. You add controls to a dialog box by using the Controls toolbar in the Dialog Editor.
  • 10. MFC Controls are the user interface objects used to create interfaces for Windows applications. Most Windows applications are nothing but a collection of controls arranged in a way that appropriately implements the functionality of the program. There are only six basic controls - CStatic, CButton, CListBox, CComboBox, CEdit, and CScrollBar - along with some minor variations (Windows added a collection of about 15 enhanced controls as well).
  • 11.
  • 12. Controls The Resource Editor makes it easy to add controls to dialog boxes. The controls are automatically created when the dialog is created. The Class Wizard makes it easy to link these controls to dialog class member functions or member variables.
  • 13. Controls Controls are actually Windows Controls are Child Windows They have their own window procedures (provided by Windows). In MFC, they inherit all the CWnd functionality.Controls are Child Windowsclipped to parent, move with parent, destroyed with parent.when using VC++ Resource Editor - parent is usually a dialog class derived from CDialog.send WM_COMMAND notifications to parent.