Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 3: Windows Resources


Outlined Round
Rectangle

Draws a round rectangle with one color for the border
(pen) and another color for the inside (brush)
Filled Round
Rectangle

Used to draw a round rectangle filling it with an interior
color while the border color is ignored
Ellipse Used to draw an ellipse or a circle

Outlined Ellipse Draws an ellipse or a circle with one color for the
border (pen) and another color for the inside (brush)

Filled Ellipse^

Used to draw an ellipse or a circle filling it with an
interior color while the border color is ignored

To use a particular tool, click it to select. Then click on the icon.

To design your icon, you can choose colors from the Colors toolbar. Because an icon
uses a background color, the default is set as green. The default icon is represented by a
small monitor icon.

To use a color, first select a tool on the Graphics toolbar, then click the desired color and
draw.

After creating an icon, you can use it for your application. There are two solutions you
can use. The default icon used by MSVC is called AFX_IDI_STD_FRAME. Therefore,
after designing your icon, you can simply set its name as this default.

Practical Learning: Creating an Icon



  1. To create an icon, on the main menu, click Project -> Insert Resource...

  2. In the Add Resource dialog box, click Icon


Figure 45: Add Resource - Icon...................................................................................................



  1. Click New

  2. In the Resource View, right-click IDI_ICON1 and click Properties.

  3. In the Properties window, click the arrow of the ID combo box and select
    AFX_IDI_STD_FRAME

Free download pdf