Visual Programming (CS410) Assignment # 4
Visual Programming (CS410) Assignment # 4
Assignment # 4
Total marks = 20
Deadline Date = 13-01-2011
1) You should concern recommended books to clarify your concepts as handouts are not
sufficient.
2) You are supposed to submit your assignment in .doc format. Any other formats like
scan images, PDF, Zip, rar, bmp, docx etc will not be accepted
3) You are advised to upload your assignment at least two days before Due date.
4) This assignment file comprises of Two (2) pages.
5) Do not send the CPP file of your code, but paste the complete code in same
document (.DOC) file in which you will solve other questions.
Important Note:
What is meant by Modal Dialog Box? Briefly explain the process of its creation.
ANSWER:
A modal dialog box should be a pop-up window having a window menu, a title bar,
and a thick border; that is, the dialog box template should specify the WS_POPUP,
WS_SYSMENU, WS_CAPTION, and DS_MODALFRAME styles.
When creating the modal dialog box, the system makes it the active window. The
dialog box remains active until the dialog box procedure calls the EndDialog function
or the system activates a window in another application. Neither the user nor the
application can make the owner window active until the modal dialog box is
destroyed.
Q2 [Marks: 3+7]
ANSWER:
List box items can be represented by text strings, bitmaps, or both. If the list box is
not large enough to display all the list box items at once, the list box provides a
scroll bar. The user scrolls through the list box items, and applies or removes
selection status as necessary. Selection style of a list box item or its visual
appearance can be changed in Operating system metrics. When the user selects or
deselects an item, the system sends a notification message to the parent window of
the list box.
There are two types of list boxes: single-selection (the default) and multiple-
selection. In a single-selection list box, the user can select only one item at a time.
In a multiple-selection list box, the user can select more than one item at a time. To
create a multiple-selection list box, specify the LBS_MULTIPLESEL or the
LBS_EXTENDEDSEL style.
There are many list box styles and window styles that control the appearance and
operation of a list box. These styles indicate whether list box items are sorted,
arranged in multiple columns, drawn by the application, and so on. The dimensions
and styles of a list box are typically defined in a dialog box template included in an
application's resources.
To create a list box by using the CreateWindow or CreateWindowEx function, use the
LISTBOX class, appropriate window style constants, and the following style constants
to define the list box. After the control has been created, these styles cannot be
modified, except as noted.