Page 83 - DCAP408_WEB_PROGRAMMING
P. 83
Unit 4: Windows Controls
From the user’s point of view, a button is functional when clicked, in which case the user Notes
places the mouse on it and presses one of the mouse’s buttons.
The most usual action users carry out on a button is to click it. When a user does this, the
button sends a BN_CLICKED message.
The most generally used combo box is called drop down. On the left side, it is prepared of
an edit box. On the right side, it is equipped with a down-pointing arrow:
A scroll bar is an object that permits the user to navigate either left and right or up and
down, either on a document or on a section of the window.
To create a scroll bar as a Windows control, call the CreateWindow() or the
CreateWindowEx() functions and specify the class name as SCROLLBAR.
One of the most generally used controls in the windows environment, the EDIT control, is
used to permit the user to enter, modify, copy, etc... text.
4.11 Keywords
BN_CLICKED: The most usual action users carry out on a button is to click it. When a user does
this, the button sends a BN_CLICKED message.
Scroll Bar: A scroll bar is an object that permits the user to navigate either left and right or up
and down, either on a document or on a section of the window.
Static Control: A static control is like an edit control, but it does not obtain typed input from the
user.
4.12 Review Questions
1. Illustrate the function that is used for creating windows.
2. What is static control? Discuss the process of sending Messages to a control.
3. What are button controls? Illustrate the steps for creating a push button.
4. Explain the concept of processing button control messages. Illustrate with example.
5. What are different types of Button Notification Codes? Explain.
6. How to add items and obtain data from the list box?
7. What is a combo box? Illustrate the steps for creating a combo box. Also illustrate it
programmatically.
8. What is a scroll bar? Make distinction between Automatic Scroll Bars and control-based
scroll bar.
9. Illustrate step by step the process of using Scroll Bar Controls.
10. Illustrate the concept of edit controls with example.
Answers: Self Assessment
1. control 2. Register Class ()
3. text static 4. CreateWindowEx
LOVELY PROFESSIONAL UNIVERSITY 77