SlideShare a Scribd company logo
Visual C# .Net using
framework 4.5
Eng. Mahmoud Ouf
Lecture 08
mmouf@2018
Menu
In windows applications, menus are used to provide a list of commands
available for user to execute in the application. Example the File menu,
which contain New, Open, Close, …
The menu that sits between a form’s title bar and the client area is referred as
main menu.
Many application support Shortcut menus, context menus, which are menus
that appear at the mouse cursor position when you right click the mouse.
A main menu is associated with a form, while context menu is associated
with a particular control, that is clicking different controls often causes
different context menus to be invoked.
A menu (main or context) contains menu items, such as File, Open, Save,..
mmouf@2018
Menu
You will find that the File and Edit menu items are different from the Open,
Save items. File, Edit are located at the visible part of the program main
menu, while other are not.
The items at the visible part are called “Top Level Item”. Selecting any Top
Level Item will invoke a menu was called “PopUp menu” or “Drop Down
Menu” but now is called SubMenu or ChildMenu.
From the Windows Forms program, The File menu item contains a
collection of other menu items contains (Open, Save,…) and the Edit menu
item contains a collection of menu items contains (Cut, Copy,…).
One step back, the Main menu itself is a collection of menu items contains
(File, Edit,…). Each menu item in the Main menu is associated with its own
array of menu items. And in some case some of these menu items have their
own array of menu items.
mmouf@2018
Menu
Similarly, a context menu is an array of menu items.
To Deal With menus, we have 3 classes:
MenuStrip (the main menu)
ToolStripMenuItem (sub menus)
ContextMenuStrip (context menu)
mmouf@2018
Menu
Creating the Main Menu
1) Create an object from the MenuStrip class
2) Create the Top Level Menu item (object from ToolStripMenuItem
class)
3) Add this object (from ToolStripMenuItem) to the object (from
MenuStrip) use “items collection”
4) Now, make the submenu item (Object from ToolStripMenuItem)
5) Add it to the Top Level Menu (use DropDownItems collections)
6) Repeat steps 4, 5 to add other submenu
7) Repeat Steps 2 to 6 to add other top level Menu items
8) Attach MainMenu to the Form
mmouf@2018
Menu
Creating the Main Menu
Step 1:
MenuStrip menuStrip1; //define the object
menuStrip1 = new MenuStrip(); //object creation
Step 2:
ToolStripMenuItem fileToolStripMenuItem =
new ToolStripMenuItem(“&File”);
Step 3:
menuStrip1.Items.Add(this.fileToolStripMenuItem);
mmouf@2018
Menu
Creating the Main Menu
Step 4:
ToolStripMenuItem exitToolStripMenuItem =
new ToolStripMenuItem (“E&xit”,
new EventHandler(this.exitToolStripMenuItem_Click));
exitToolStripMenuItem.ShortcutKeys = (Keys)(Keys.Control | Keys.X);
Step 5:
fileToolStripMenuItem.DropDownItems.Add(this.exitToolStripMenuItem);
Step 8:
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
mmouf@2018
Menu
Creating the Main Menu
Step 4:
ToolStripMenuItem exitToolStripMenuItem =
new ToolStripMenuItem (“E&xit”,
new EventHandler(this.exitToolStripMenuItem_Click));
exitToolStripMenuItem.ShortcutKeys = (Keys)(Keys.Control | Keys.X);
Step 5:
fileToolStripMenuItem.DropDownItems.Add(this.exitToolStripMenuItem);
Step 8:
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
mmouf@2018
Menu
Creating the Main Menu
The & in the menu name string, tell which variable will be associated with
the Alt key to open the menu
Also, each command may have a shortcut to execute this command with no
need to open the menu
mmouf@2018
Context Menu
Creating the Context Menu
1) Create an object from the ContextMenuStrip class
2) Now, make the submenu item (object from ToolStripMenuItem)
3) Add it to the ContextMenuStrip (using Items collections)
4) Repeat steps 2, 3 to add other submenu
5) Attach ContextMenuStrip to the Form (through contextMenuStrip
property of the form)
mmouf@2018
Toolbar
Toolbars provides an alternate means to activate a given menu item. Most
applications use toolbar images that are 16 pixels square.
This is done by ToolStrip class
It can Contains:
ToolStripButton,
ToolStripLabel,
ToolStripDropDownButton,
ToolStripComboBox,
ToolStripTextBox
mmouf@2018
Toolbar
Creating and using Toolbar
1) Create object From ToolStrip class
2) Create objects From ToolStripButton, ToolStripLabel, … class
3) Configure each object
4) Configure toolbar and Add buttons (using Items collection)
5) Add the new bar to the control (using Controls collection)
mmouf@2018
Status bar
Status bars usually conveys textual information to the user.
This is done by StatusStrip class
It can Contains:
ToolStripStatusLabel,
ToolStripDropDownButton,
ToolStripProgressBar
Creating and using Status bar
1) Create object From StatusStrip class
2) Create objects From ToolStripStatusLabel,
ToolStripDropDownButton, … class
3) Configure each object
4) Configure status bar and Add buttons (using Items collection)
5) Add the new bar to the control (using Controls collection)
mmouf@2018

More Related Content

What's hot

C# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slidesC# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slides
Sami Mut
 
Chapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface DesignChapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface Design
francopw
 
SPF WinForm Programs
SPF WinForm ProgramsSPF WinForm Programs
SPF WinForm Programs
Hock Leng PUAH
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
Moutasm Tamimi
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinFormHock Leng PUAH
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
prabhu rajendran
 
Windows Forms For Beginners Part - 4
Windows Forms For Beginners Part - 4Windows Forms For Beginners Part - 4
Windows Forms For Beginners Part - 4
Bhushan Mulmule
 
Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1
Bhushan Mulmule
 
06 win forms
06 win forms06 win forms
06 win forms
mrjw
 
visual basic programming
visual basic programmingvisual basic programming
visual basic programming
sowndaryadharmaraj
 
Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3
Bhushan Mulmule
 
Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5
Bhushan Mulmule
 
Controls events
Controls eventsControls events
Controls events
Dalwin INDIA
 
Class viii ch-7 visual basic 2008
Class  viii ch-7 visual basic 2008Class  viii ch-7 visual basic 2008
Class viii ch-7 visual basic 2008
jessandy
 
Chapter 07
Chapter 07Chapter 07
Chapter 07llmeade
 
Visual Basic Programming
Visual Basic ProgrammingVisual Basic Programming
Visual Basic Programming
Osama Yaseen
 
Session 1. Bai 1 ve winform
Session 1. Bai 1 ve winformSession 1. Bai 1 ve winform
Session 1. Bai 1 ve winformmrtom16071980
 
Mat. pemvis pertemuan iv
Mat. pemvis pertemuan ivMat. pemvis pertemuan iv
Mat. pemvis pertemuan iv
Husna Rusdiani
 

What's hot (20)

C# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slidesC# Tutorial MSM_Murach chapter-17-slides
C# Tutorial MSM_Murach chapter-17-slides
 
Chapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface DesignChapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface Design
 
SPF WinForm Programs
SPF WinForm ProgramsSPF WinForm Programs
SPF WinForm Programs
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
 
Windows Forms For Beginners Part - 4
Windows Forms For Beginners Part - 4Windows Forms For Beginners Part - 4
Windows Forms For Beginners Part - 4
 
Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1Windows Forms For Beginners Part - 1
Windows Forms For Beginners Part - 1
 
06 win forms
06 win forms06 win forms
06 win forms
 
visual basic programming
visual basic programmingvisual basic programming
visual basic programming
 
Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3
 
Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5
 
Controls events
Controls eventsControls events
Controls events
 
Active x control
Active x controlActive x control
Active x control
 
Class viii ch-7 visual basic 2008
Class  viii ch-7 visual basic 2008Class  viii ch-7 visual basic 2008
Class viii ch-7 visual basic 2008
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
 
Vb basics
Vb basicsVb basics
Vb basics
 
Visual Basic Programming
Visual Basic ProgrammingVisual Basic Programming
Visual Basic Programming
 
Session 1. Bai 1 ve winform
Session 1. Bai 1 ve winformSession 1. Bai 1 ve winform
Session 1. Bai 1 ve winform
 
Mat. pemvis pertemuan iv
Mat. pemvis pertemuan ivMat. pemvis pertemuan iv
Mat. pemvis pertemuan iv
 

Similar to Intake 38 8

Intake 37 8
Intake 37 8Intake 37 8
Intake 37 8
Mahmoud Ouf
 
1 PROBLEM You are to design and implement a Menu class.docx
1 PROBLEM You are to design and implement a Menu class.docx1 PROBLEM You are to design and implement a Menu class.docx
1 PROBLEM You are to design and implement a Menu class.docx
honey725342
 
Android session 3
Android session 3Android session 3
Android session 3
Ahesanali Suthar
 
Vs c# lecture5
Vs c# lecture5Vs c# lecture5
Vs c# lecture5
Saman M. Almufti
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Ahsanul Karim
 
Swing jecrc
Swing jecrc Swing jecrc
Swing jecrc
guest199adf
 
Components of windows.36
Components of windows.36Components of windows.36
Components of windows.36myrajendra
 
360 Flex Atlanta
360 Flex Atlanta360 Flex Atlanta
360 Flex Atlanta
rtretola
 
Module iii part i
Module iii part iModule iii part i
Module iii part i
Sumaja Varma
 
How do i add a file menu to my java programSolutionHere goes .pdf
How do i add a file menu to my java programSolutionHere goes .pdfHow do i add a file menu to my java programSolutionHere goes .pdf
How do i add a file menu to my java programSolutionHere goes .pdf
fathimaoptical
 
Menu bars and menus
Menu bars and menusMenu bars and menus
Menu bars and menusmyrajendra
 
INTRODUCTION The goal of this programming project is to entble studen.pdf
 INTRODUCTION The goal of this programming project is to entble studen.pdf INTRODUCTION The goal of this programming project is to entble studen.pdf
INTRODUCTION The goal of this programming project is to entble studen.pdf
ameancal
 
Android menus in android-chapter15
Android menus in android-chapter15Android menus in android-chapter15
Android menus in android-chapter15
Dr. Ramkumar Lakshminarayanan
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAhsanul Karim
 
Autodesk maya 2016 basic guide
Autodesk maya 2016 basic guideAutodesk maya 2016 basic guide
Autodesk maya 2016 basic guide
Đỗ Hải
 

Similar to Intake 38 8 (20)

Intake 37 8
Intake 37 8Intake 37 8
Intake 37 8
 
Android ui menu
Android ui menuAndroid ui menu
Android ui menu
 
android menus
android menusandroid menus
android menus
 
1 PROBLEM You are to design and implement a Menu class.docx
1 PROBLEM You are to design and implement a Menu class.docx1 PROBLEM You are to design and implement a Menu class.docx
1 PROBLEM You are to design and implement a Menu class.docx
 
Android session 3
Android session 3Android session 3
Android session 3
 
Vs c# lecture5
Vs c# lecture5Vs c# lecture5
Vs c# lecture5
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]Day 5: Android User Interface [View Widgets]
Day 5: Android User Interface [View Widgets]
 
Swing jecrc
Swing jecrc Swing jecrc
Swing jecrc
 
Gui
GuiGui
Gui
 
Components of windows.36
Components of windows.36Components of windows.36
Components of windows.36
 
360 Flex Atlanta
360 Flex Atlanta360 Flex Atlanta
360 Flex Atlanta
 
Module iii part i
Module iii part iModule iii part i
Module iii part i
 
01 10 - graphical user interface - others
01  10 - graphical user interface - others01  10 - graphical user interface - others
01 10 - graphical user interface - others
 
How do i add a file menu to my java programSolutionHere goes .pdf
How do i add a file menu to my java programSolutionHere goes .pdfHow do i add a file menu to my java programSolutionHere goes .pdf
How do i add a file menu to my java programSolutionHere goes .pdf
 
Menu bars and menus
Menu bars and menusMenu bars and menus
Menu bars and menus
 
INTRODUCTION The goal of this programming project is to entble studen.pdf
 INTRODUCTION The goal of this programming project is to entble studen.pdf INTRODUCTION The goal of this programming project is to entble studen.pdf
INTRODUCTION The goal of this programming project is to entble studen.pdf
 
Android menus in android-chapter15
Android menus in android-chapter15Android menus in android-chapter15
Android menus in android-chapter15
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form Widgets
 
Autodesk maya 2016 basic guide
Autodesk maya 2016 basic guideAutodesk maya 2016 basic guide
Autodesk maya 2016 basic guide
 

More from Mahmoud Ouf

Relation between classes in arabic
Relation between classes in arabicRelation between classes in arabic
Relation between classes in arabic
Mahmoud Ouf
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
Mahmoud Ouf
 
Intake 38 data access 4
Intake 38 data access 4Intake 38 data access 4
Intake 38 data access 4
Mahmoud Ouf
 
Intake 38 data access 3
Intake 38 data access 3Intake 38 data access 3
Intake 38 data access 3
Mahmoud Ouf
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1
Mahmoud Ouf
 
Intake 38 12
Intake 38 12Intake 38 12
Intake 38 12
Mahmoud Ouf
 
Intake 38 11
Intake 38 11Intake 38 11
Intake 38 11
Mahmoud Ouf
 
Intake 38 10
Intake 38 10Intake 38 10
Intake 38 10
Mahmoud Ouf
 
Intake 38 9
Intake 38 9Intake 38 9
Intake 38 9
Mahmoud Ouf
 
Intake 38 7
Intake 38 7Intake 38 7
Intake 38 7
Mahmoud Ouf
 
Intake 38 6
Intake 38 6Intake 38 6
Intake 38 6
Mahmoud Ouf
 
Intake 38 5 1
Intake 38 5 1Intake 38 5 1
Intake 38 5 1
Mahmoud Ouf
 
Intake 38 5
Intake 38 5Intake 38 5
Intake 38 5
Mahmoud Ouf
 
Intake 38 4
Intake 38 4Intake 38 4
Intake 38 4
Mahmoud Ouf
 
Intake 38 3
Intake 38 3Intake 38 3
Intake 38 3
Mahmoud Ouf
 
Intake 38 2
Intake 38 2Intake 38 2
Intake 38 2
Mahmoud Ouf
 
Intake 38_1
Intake 38_1Intake 38_1
Intake 38_1
Mahmoud Ouf
 
Intake 37 DM
Intake 37 DMIntake 37 DM
Intake 37 DM
Mahmoud Ouf
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
Mahmoud Ouf
 
Intake 37 ef1
Intake 37 ef1Intake 37 ef1
Intake 37 ef1
Mahmoud Ouf
 

More from Mahmoud Ouf (20)

Relation between classes in arabic
Relation between classes in arabicRelation between classes in arabic
Relation between classes in arabic
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
 
Intake 38 data access 4
Intake 38 data access 4Intake 38 data access 4
Intake 38 data access 4
 
Intake 38 data access 3
Intake 38 data access 3Intake 38 data access 3
Intake 38 data access 3
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1
 
Intake 38 12
Intake 38 12Intake 38 12
Intake 38 12
 
Intake 38 11
Intake 38 11Intake 38 11
Intake 38 11
 
Intake 38 10
Intake 38 10Intake 38 10
Intake 38 10
 
Intake 38 9
Intake 38 9Intake 38 9
Intake 38 9
 
Intake 38 7
Intake 38 7Intake 38 7
Intake 38 7
 
Intake 38 6
Intake 38 6Intake 38 6
Intake 38 6
 
Intake 38 5 1
Intake 38 5 1Intake 38 5 1
Intake 38 5 1
 
Intake 38 5
Intake 38 5Intake 38 5
Intake 38 5
 
Intake 38 4
Intake 38 4Intake 38 4
Intake 38 4
 
Intake 38 3
Intake 38 3Intake 38 3
Intake 38 3
 
Intake 38 2
Intake 38 2Intake 38 2
Intake 38 2
 
Intake 38_1
Intake 38_1Intake 38_1
Intake 38_1
 
Intake 37 DM
Intake 37 DMIntake 37 DM
Intake 37 DM
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
 
Intake 37 ef1
Intake 37 ef1Intake 37 ef1
Intake 37 ef1
 

Recently uploaded

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 

Recently uploaded (20)

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 

Intake 38 8

  • 1. Visual C# .Net using framework 4.5 Eng. Mahmoud Ouf Lecture 08 mmouf@2018
  • 2. Menu In windows applications, menus are used to provide a list of commands available for user to execute in the application. Example the File menu, which contain New, Open, Close, … The menu that sits between a form’s title bar and the client area is referred as main menu. Many application support Shortcut menus, context menus, which are menus that appear at the mouse cursor position when you right click the mouse. A main menu is associated with a form, while context menu is associated with a particular control, that is clicking different controls often causes different context menus to be invoked. A menu (main or context) contains menu items, such as File, Open, Save,.. mmouf@2018
  • 3. Menu You will find that the File and Edit menu items are different from the Open, Save items. File, Edit are located at the visible part of the program main menu, while other are not. The items at the visible part are called “Top Level Item”. Selecting any Top Level Item will invoke a menu was called “PopUp menu” or “Drop Down Menu” but now is called SubMenu or ChildMenu. From the Windows Forms program, The File menu item contains a collection of other menu items contains (Open, Save,…) and the Edit menu item contains a collection of menu items contains (Cut, Copy,…). One step back, the Main menu itself is a collection of menu items contains (File, Edit,…). Each menu item in the Main menu is associated with its own array of menu items. And in some case some of these menu items have their own array of menu items. mmouf@2018
  • 4. Menu Similarly, a context menu is an array of menu items. To Deal With menus, we have 3 classes: MenuStrip (the main menu) ToolStripMenuItem (sub menus) ContextMenuStrip (context menu) mmouf@2018
  • 5. Menu Creating the Main Menu 1) Create an object from the MenuStrip class 2) Create the Top Level Menu item (object from ToolStripMenuItem class) 3) Add this object (from ToolStripMenuItem) to the object (from MenuStrip) use “items collection” 4) Now, make the submenu item (Object from ToolStripMenuItem) 5) Add it to the Top Level Menu (use DropDownItems collections) 6) Repeat steps 4, 5 to add other submenu 7) Repeat Steps 2 to 6 to add other top level Menu items 8) Attach MainMenu to the Form mmouf@2018
  • 6. Menu Creating the Main Menu Step 1: MenuStrip menuStrip1; //define the object menuStrip1 = new MenuStrip(); //object creation Step 2: ToolStripMenuItem fileToolStripMenuItem = new ToolStripMenuItem(“&File”); Step 3: menuStrip1.Items.Add(this.fileToolStripMenuItem); mmouf@2018
  • 7. Menu Creating the Main Menu Step 4: ToolStripMenuItem exitToolStripMenuItem = new ToolStripMenuItem (“E&xit”, new EventHandler(this.exitToolStripMenuItem_Click)); exitToolStripMenuItem.ShortcutKeys = (Keys)(Keys.Control | Keys.X); Step 5: fileToolStripMenuItem.DropDownItems.Add(this.exitToolStripMenuItem); Step 8: this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; mmouf@2018
  • 8. Menu Creating the Main Menu Step 4: ToolStripMenuItem exitToolStripMenuItem = new ToolStripMenuItem (“E&xit”, new EventHandler(this.exitToolStripMenuItem_Click)); exitToolStripMenuItem.ShortcutKeys = (Keys)(Keys.Control | Keys.X); Step 5: fileToolStripMenuItem.DropDownItems.Add(this.exitToolStripMenuItem); Step 8: this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; mmouf@2018
  • 9. Menu Creating the Main Menu The & in the menu name string, tell which variable will be associated with the Alt key to open the menu Also, each command may have a shortcut to execute this command with no need to open the menu mmouf@2018
  • 10. Context Menu Creating the Context Menu 1) Create an object from the ContextMenuStrip class 2) Now, make the submenu item (object from ToolStripMenuItem) 3) Add it to the ContextMenuStrip (using Items collections) 4) Repeat steps 2, 3 to add other submenu 5) Attach ContextMenuStrip to the Form (through contextMenuStrip property of the form) mmouf@2018
  • 11. Toolbar Toolbars provides an alternate means to activate a given menu item. Most applications use toolbar images that are 16 pixels square. This is done by ToolStrip class It can Contains: ToolStripButton, ToolStripLabel, ToolStripDropDownButton, ToolStripComboBox, ToolStripTextBox mmouf@2018
  • 12. Toolbar Creating and using Toolbar 1) Create object From ToolStrip class 2) Create objects From ToolStripButton, ToolStripLabel, … class 3) Configure each object 4) Configure toolbar and Add buttons (using Items collection) 5) Add the new bar to the control (using Controls collection) mmouf@2018
  • 13. Status bar Status bars usually conveys textual information to the user. This is done by StatusStrip class It can Contains: ToolStripStatusLabel, ToolStripDropDownButton, ToolStripProgressBar Creating and using Status bar 1) Create object From StatusStrip class 2) Create objects From ToolStripStatusLabel, ToolStripDropDownButton, … class 3) Configure each object 4) Configure status bar and Add buttons (using Items collection) 5) Add the new bar to the control (using Controls collection) mmouf@2018