1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

creating buttons in visual c++

Discussion in 'MFC' started by hansraj, Mar 23, 2010.

  1. hansraj

    hansraj New Member

    Joined:
    Mar 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    I am just a beginner trying to create buttons and integrate them, does any one has an idea of how to create the buttons and integrate it in our application. Also once imported how to work on those buttons, such as producing sound when a button is clicked by the user.
     
  2. raju00003

    raju00003 New Member

    Joined:
    Dec 22, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    I can able to create buttons , but i don't know how to add event handling at time

    i hope this ll help 2 u for your update your knowledge

    Add this code your initdialoag() function

    Code:
    
    CButton * button = new CButton;
    
    CRect rect ( 10 ,10 ,100,50);
    
    buttons->create("ButttonName",WS_VISIBLE|WS_CHILD,&rect,this,0);
    
    
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    You have to use the Message Map Macro to add events manually or can even use the MFC Wizard to add events for you.
     
  4. raju00003

    raju00003 New Member

    Joined:
    Dec 22, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    thanks shabbir ..:2thumbsup
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83

Share This Page