How to Use MFC Toolbars

A toolbar is a control bar that holds small bitmap image buttons of controls and commands which are used in Microsoft Foundation classes, global functions, global variables and macros. Use MFC Toolbars in the following sample programs to illustrate their function and tools: SCRIBBLE, CTRLBARS, DOCKTOOL.

Instructions

    • 1

      Obtain Microsoft Foundation Class in Windows 95 or a newer version of Windows Operating Systems.

    • 2

      Position the toolbar in the MFC open window. Drag and dock or simply attach the MFC Toolbar to any side or sides of the primary window or suspend the MFC Toolbars along one side of the window.

    • 3

      Move the toolbar to "float" or detach from the frame window. Position the toolbar in a convenient location. Also resize the toolbar while it is floating.

    • 4

      Make MFC toolbars to display "Tool tips." "Tool tips" are tiny popup windows that contain a small text description for the toolbar button's function and purpose.

    • 5

      Use the tool bar editor. The editor allows you to easily add, delete or arrange buttons. It also acts as an editor to change graphics and buttons.

    • 6

      Give buttons Command ID. An example of a Command ID is ID_MYCOMMAND.
      Identify the Command ID in the button's property page, which can be accessed using the toolbar editor. Also create a handler function for the command.

    • 7

      Create a toolbar resource in the toolbar editor. Load the new toolbar in OnCreate with the LoadToolbar member function. Also embed the new CToolBar into your main frame window and allow it to dock or float.

Related Searches:

Comments

You May Also Like

Related Ads

Featured