0% found this document useful (0 votes)
100 views

Bahria University, Lahore Campus: Department of Computer Sciences

This document summarizes a lab assignment on human computer interaction involving menus. The objectives are to implement different types of menus including a main menu, contextual menus, and different menu structures. Tasks include creating a menu to change font style and color, grouping word processing functions into appropriate menu headings, and designing Windows form applications demonstrating deep and narrow and broad and shallow menu structures. The document provides examples and solutions for implementing the tasks, including code samples for creating a menu and handling menu item clicks to change font properties. It also discusses the differences between main menus and popup menus.

Uploaded by

Yaseen Rana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views

Bahria University, Lahore Campus: Department of Computer Sciences

This document summarizes a lab assignment on human computer interaction involving menus. The objectives are to implement different types of menus including a main menu, contextual menus, and different menu structures. Tasks include creating a menu to change font style and color, grouping word processing functions into appropriate menu headings, and designing Windows form applications demonstrating deep and narrow and broad and shallow menu structures. The document provides examples and solutions for implementing the tasks, including code samples for creating a menu and handling menu item clicks to change font properties. It also discusses the differences between main menus and popup menus.

Uploaded by

Yaseen Rana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Bahria University, Lahore Campus

Department of Computer Sciences


Lab Journal 05
(Spring 2019)

Course: Human Computer Interaction Lab Date:


Course Code: Max Marks:
Faculty’s Name: Mr. Zakir Ali Lab Engineer : Atta ur rehman

Name: _____________________________ Enroll No: _______________________

Objective(s):
Interaction Styles: Menus

Lab Tasks:

Task 1: Implementation Create a menu shown in the figure. Change the font style and the
color of the font with the help of this menu

Task 2 : Group the following functions under appropriate headings, assuming that they
are to form the basis for a menu-driven word-processing system

Task 3: Design a Windows form application depicting the “Broad and Shallow” menu
structure of your choice

Lab Grading Sheet :


Max Obtained
Task Comments(if any)
Marks Marks
1. 10

2. 10

3. 10

Total 30 Signature

Note : Attempt all tasks and get them checked by your Lab Instructor
Lab 5 Interaction Styles: Menus
5.1 The Main Menu Creation
To support actions that are used to graphically
enhance the functionality of an application,
the .NET Framework provides the ToolStrip
class. To support menus for an application,
the .NET Framework provides the
MenuStripclass.To graphically create a main
menu, in the Menus & Toolbars section of the
Toolbox, you can click the MenuStrip button

and click the form that will use the menu.


After clicking the form, an empty menu is
initiated:

5.2The Contextual Menus

A contextual menu is one that appears when the


user right-clicks an area of an application or form.
In most applications, when the user right-clicks a
title bar, the operating system is configured to
display a system menu.
Pop-Up Menu
A menu is considered, or qualifies as, popup if,
or because, it can appear anywhere on the form
as the programmer wishes. Such a menu is also
referred to as context-sensitive or contextual
because its appearance and behavior depend on
where it displays on the form or on a particular
control. The person who creates the application
decides if or where the contextual menu would
appear.
Difference between Main-menu and Pop-Up
Menu

The first difference between a main menu and a


popup menu is that a popup menu appears as one
category or one list of items and not like a group of
categories of menus like a main menu. Secondly,
while a main menu by default is positioned on the top section of a form, a popup menu doesn't
have a specific location on the form.

Lab 5 Exercise

Exercise 5.1
Create a menu shown in the figure. Change the font style and the color of the font with the help of this
menu

Solution:

private void ClearColor()


{
blackMenuItem.Checked = false;
blueMenuItem.Checked = false;
redMenuItem.Checked = false;
greenMenuItem.Checked = false;
}

private void blackMenuItem_Click( object sender, EventArgs e )


{
ClearColor();
displayLabel.ForeColor = Color. Black;
blackMenuItem.Checked = true;
}

private void blueToolStripMenuItem_Click(object sender, EventArgs e )


{
ClearColor();
displayLabel.ForeColor = Color.Blue;
blueToolStripMenuItem.Checked = true;
}

//Write the same functions for Red and Green Tool Strip Item

private void ClearFont()


{// clear all checkmarks
timesMenuItem.Checked = false;
courierMenuItem.Checked = false
comicMenuItem.Checked = false;
}

private void timesToolStripMenuItem_Click( object sender, EventArgs e )


{//Changes font to Times New Roman
ClearFont();
timesMenuItem.Checked = true;
displayLabel.Font = new Font( “Times New Roman“, 14, displayLabel.Font.Style );
}

private void courierToolStripMenuItem_Click( object sender, EventArgs e )


{
ClearFont();
courierToolStripMenuItem.Checked = true;
displayLabel.Font = new Font( “Courier”, 14,displayLabel.Font.Style );
}

private void italicToolStripMenuItem_Click( object sender, EventArgs e )


{
italicToolStripMenuItem.Checked= !italicToolStripMenuItem.Checked;
displayLabel.Font = new Font(displayLabel.FontdisplayLabel.Font.Style ^ FontStyle.Italic );
}
//Write similar functions for Bold and Comic San Font style

Exercise 5.2 Answer the following questions

a) Group the following functions under appropriate headings, assuming that they are to form
the basis for a menu-driven word-processing system – the headings you choose will
become the menu titles, with the functions appearing under the appropriate one. You can
choose as many or as few menu headings as you wish. Why do some functions always
seem to be grouped together?

save, save as, new, delete, open mail, send mail, quit, undo, table, glossary, preferences,
character style, format paragraph, lay out document, position on page, plain text, bold
text, italic text, underline, open file, close file, open copy of file, increase point size,
decrease point size, change font, add footnote, cut, copy, paste, clear, add page break,
insert graphic, insert index entry, print preview, page setup, view page, find word, change
word, go to, go back, check spelling, view index, see table of contents, count words,
renumber pages, repeat edit, show alternative document, help

b) Design a menu bar using windows form application keeping in mind the headings that
were created in part a.

Exercise 5.3: Answer the following questions

a) Deep and Narrow Menu

If we have a large content environment on a


mobile device, we need some way to access
that content with ease. One could implement
a narrow and deep navigation pattern
which gives the possibility for larger
navigation elements to be presented to the
user. There will be less errors clicking
through content, but there will be more
clicks to perform to access the content we’re
after.

Design a Windows form application


depicting the “Deep and Narrow” menu
structure of your choice

b) Broad and Shallow Menus

If we implement the opposite style,


where we have a broad and shallow
navigation pattern, there will be less
click to perform, but there will be harder
to find what to click, especially if the
navigation elements need to be scrolled
through.

Design a Windows form application


depicting the “Broad and Shallow” menu
structure of your choice

c) Identify which structure is better for a


web application, Mobile application and
Desktop application.

You might also like