SlideShare a Scribd company logo
4
Most read
9
Most read
10
Most read
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).
Visual programming is a type of programming
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

PPT
Session 5 Bai 5 ve winform
PPTX
Windowforms controls c#
PDF
Intake 37 9
PDF
Intake 38 9
PPT
4.1 Thecast by roshan kumar sah lecture slide
PDF
VB PPT by ADI PART4.pdf
PDF
VB PPT by ADI PART4.pdf
PPTX
Visual basic programming
Session 5 Bai 5 ve winform
Windowforms controls c#
Intake 37 9
Intake 38 9
4.1 Thecast by roshan kumar sah lecture slide
VB PPT by ADI PART4.pdf
VB PPT by ADI PART4.pdf
Visual basic programming

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

PPTX
Visual basic programming
PPTX
Windows programming
PPTX
Visual Basic Controls ppt
PPT
Windows programming ppt
PPTX
Visual basic
PDF
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
PPTX
Visual Basic.pptx
PPT
VB.Net GUI Unit_01
PDF
Tutorial 37 API Coding
PPTX
control structure in visual basic
PPT
Vb basic
PPT
VC++ Fundamentals
PPT
introduction to_mfc
PPT
Buttons In .net Visual Basic
PPTX
INTRODUCTION-TO-VB (2)-PROJECT POWERPOINT.pptx
PPT
PPT
Vc++ 2
PDF
Notes windows form controls gui applications
PPTX
INTRODUCTION-TO-VB (1).pptx introduction
Visual basic programming
Windows programming
Visual Basic Controls ppt
Windows programming ppt
Visual basic
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
Visual Basic.pptx
VB.Net GUI Unit_01
Tutorial 37 API Coding
control structure in visual basic
Vb basic
VC++ Fundamentals
introduction to_mfc
Buttons In .net Visual Basic
INTRODUCTION-TO-VB (2)-PROJECT POWERPOINT.pptx
Vc++ 2
Notes windows form controls gui applications
INTRODUCTION-TO-VB (1).pptx introduction
Ad

More from sanaiftikhar23 (9)

PPTX
Multiple Regression in machine learning.pptx
PPTX
Object Oriented Programming fundamentals.pptx
PPTX
Object Oriented Programming Language is an oop
PPTX
MobApp 07 componentof screen layout.pptx
PPTX
Displaying google maps in mobileapplication.pptx
PPTX
MobApp development 01 application platform.pptx
PPT
L21-Introduction-to-IO.ppt
PDF
fundamentals-of-algorithm-2nd-lec-170418023540.pdf
PPTX
templates.pptx
Multiple Regression in machine learning.pptx
Object Oriented Programming fundamentals.pptx
Object Oriented Programming Language is an oop
MobApp 07 componentof screen layout.pptx
Displaying google maps in mobileapplication.pptx
MobApp development 01 application platform.pptx
L21-Introduction-to-IO.ppt
fundamentals-of-algorithm-2nd-lec-170418023540.pdf
templates.pptx
Ad

Recently uploaded (20)

PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
DOCX
UPPER GASTRO INTESTINAL DISORDER.docx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Cell Structure & Organelles in detailed.
PDF
Pre independence Education in Inndia.pdf
PDF
Open folder Downloads.pdf yes yes ges yes
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
PDF
The Final Stretch: How to Release a Game and Not Die in the Process.
PDF
Business Ethics Teaching Materials for college
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Cardiovascular Pharmacology for pharmacy students.pptx
UPPER GASTRO INTESTINAL DISORDER.docx
human mycosis Human fungal infections are called human mycosis..pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Insiders guide to clinical Medicine.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Cell Structure & Organelles in detailed.
Pre independence Education in Inndia.pdf
Open folder Downloads.pdf yes yes ges yes
Pharma ospi slides which help in ospi learning
Open Quiz Monsoon Mind Game Final Set.pptx
The Final Stretch: How to Release a Game and Not Die in the Process.
Business Ethics Teaching Materials for college

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).
  • 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.