Application developed with Microsoft Visual C++, Part 10.

 

8th Step, The IDD_ABOUTBOX dialog. - (Created by AppWizard)


Before modification :

  1. The IDD_ABOUTBOX dialog design.

    About TestVC0


  2. The TestVC0.rc file stores information about all controls included in IDD_ABOUBOX. Examine this information, click here.
     
  3. The TestVC0Dlg.cpp file stores the text Code concerning the IDC_ABOUTBOX dialog. Examine the
    text Code,
    click here.
     

After modification :

  1. The IDD_ABOUTBOX dialog design.

    About TestVC0


  2. Modify the IDD_ABOUTBOX dialog properties :
    Right click the Dialog and click Properties on the shortcut menu to open the Dialog Properties dialog box:
      The old values The new values
    General tab
    * ID:
    * Caption:
    Styles tab
    * Style:
    * Border:
    *
    boxes checked
    More Styles tab
    *
    boxes checked

    IDD_ABOUBOX
    About TestVC0

    Popup
    Dilog Frame
    Title bar, System menu

    IDD_ABOUBOX
    About TestVC0

    Popup
    Dilog Frame
    Title bar, System menu

    Visible, Center


  3. Graphic ...

    Create the new Bitmap file - IAbout.bmp:
    • Select TestVC0 resources. From the right mouse pop-up menu, click Insert.
    • In the Insert Resources dialog box appears, select Bitmap Icon and then click New.

      Note:
      New Bitmap item appears.
    • In the Bitmap Window appears, draw the word: A
      B
      O
      U
      T
    • Select the IDB_BITMAP1 of the folder Bitmap. From the right mouse pop-up menu, click Properties.
    • In the Bitmap Properties dialog box appears, modify the data:
      The old values The new values
      ID: IDB_BITMAP1
      File name: res\bitmap1.bmp
      ID: IDB_ABOUT
      File name: res\IA
      bout.bmp

      From the File menu, click Save.

  4. Controls ...

    1. Remove the Static Text - IDC_STATIC, (Caption = Copyright (C) 2002).

    2. Modify the Picture - IDC_STATIC, Piture Properties:
      Right click the Picture and click Properties on the shortcut menu to open the Picture Properties dialog box:
        The old values The new values
      General tab
      * ID:
      *
      box checked
      * Type:
      * Image:

      IDC_STATIC
      Visible
      Icon
      IDR_MAINFRAME

      IDC_STATIC
      Visible
      Bitmap
      IDB_ABOUT


    3. Modify the Static Text - IDC_STATIC: - (Caption: TestVC0 Verrsion 1.0)
      Right click the Static Text and click Properties on the shortcut menu to open the Text Properties dialog box:
        The old values The new values
      General tab
      * ID:
      *Caption
      *
      boxes checked
      Styles tab
      * Align text:

      IDC_STATIC
      TestVC0 Verrsion 1.0
      Visible, Group

      Default

      IDC_STATIC
      Info about ...
      Visible, Group

      Default


    4. Add the Edit Box - IDC_EDSOURCE, Edit Properties:
      Right click the Edit Box and click Properties on the shortcut menu to open the Edit Properties dialog box:
      General tab
      * ID:
      *
      boxes checked
      Styles tab
      * Align text:
      * boxes checked
      Extended Styples tab
      *
      box checked

      IDC_EDSOURCE
      Visible, Tab stop

      left
      Multiline, Auto Vscroll, Read-only

      Transparent


    5. Add the Picture - IDC_STATIC (Frame), Picture Properties:
      Right click the Picture and click Properties on the shortcut menu to open the Piture Properties dialog box:
      General tab
      * ID:
      *
      box checked
      * Type:
      * Color:

      IDC_STATIC
      Visible
      Frame
      Black


    6. Add the Push Button - IDC_CREATED, Push Button Properties:
      Right click the Button and click Properties on the shortcut menu to open the Push Button Properties dialog box:
      General tab
      * ID:
      * Caption:
      *
      boxes checked
      Styles tab
      * Horizontal alignment:
      * Vertical alignment:

      IDC_CREATED
      Created by
      Visible, Tab stop

      Default
      Default


    7. Modify the Push Button - IDOK, Push Button Properties: - (created by AppWizard)
      Right click the Button and click Properties on the shortcut menu to open the Push Button Properties dialog box:
        The old values The new values
      General tab
      * ID:
      * Caption:
      *
      boxes checked
      Styles tab
      * Horizontal alignment:
      * Vertical alignment:

      IDOK
      OK
      Visible, Tab stop

      Default
      Default

      IDOK
      Done
      Visible, Tab stop

      Default
      Default


    Note:
    The TestVC0.rc file stores information about all controls included in IDD_
    ABOUBOX. Examine this
    information,
    click here.
     


  5. Multi - operation ...
    1. Add a member Variable.
      1. On the View menu, click ClassWizard.
        The MFC ClassWizard dialog box appears, click the Member Variables tab.

        Note:
        This tab, contains a list box displaying the mapping between controls and member variables.
      2. In the Class name box, select the class CAboutDlg.
      3. Select the name of the Control ID you want to add a variable - IDC_ EDSOURCE.
      4. Click Add Variable, the Add Member Variable dialog box appears.
      5. In the Member variable name text box, type the name of the variable - m_edsource.
      6. In the Category drop-down list, select the appropriate type of variable - Value.
      7. In the Variable type drop-down list, select the appropriate class that defines the
        variable's data type - CString.
      8. Click OK.

        Note:
        The member name and type you specified now appear in the Control IDs list.

      ClassWizard makes changes to TestVC0Dlg.cpp file after you’ve mapped the controls to
      member variables. Examine these changes,
      click here.

    2. Initialize the data ...
      To display the 1st record of the database file - KJV.mdb. The record stores information about
      this database.
      This operation make changes to TestVC0Dlg.h and TestVC0Dlg.cpp files. Examine these
      changes,
      click here.

    3. Save this application.
      Run
      it, from Build menu, choose and click Execute TestVC0.exe.

Previous
Home 10 Home
Next