Thread: mfc buttons

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    28

    mfc buttons

    Could someone post an example of how to dynamically create command buttons with MFC? All tutorials around are about dialog-based applications. Thank you.

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    As you gave no info I can not be more specific.


    Code:
    #define IDB_ABUTTON  40001
    
    CButton AButton;
    
    AButton.Create("A Button",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON , CRect(10,10,50,200), this, IDB_ABUTTON);
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    28
    Nice, it worked! I can't remember what I was doing wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to change font of button's caption using MFC
    By urvashi in forum Windows Programming
    Replies: 5
    Last Post: 04-27-2004, 06:09 AM
  2. Switching Default Buttons :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 07-02-2002, 04:08 PM
  3. Enable/Disable Frame Buttons :: MFC
    By kuphryn in forum Windows Programming
    Replies: 6
    Last Post: 06-24-2002, 08:14 AM
  4. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 08:52 PM
  5. Replies: 1
    Last Post: 05-23-2002, 11:19 PM