CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    224

    Radio Button crashes program when clicked!?!!

    Hi all,

    I want to replace normal buttons by radio buttons. So far it works fine. But when i click the damned radio button the program hangs no error no nothing, it just hangs.
    The methods called on click do nothing by now!

    What i want to do is select one of tree options with those radio buttons and therefor i have first to lock them against each other (only one can be selected) and then change a variable. any ideas on how to do that??

    Does MFC have a class for radio buttons such as CButton for normal buttons??

    10x for the help

    Regards
    Mao_03

  2. #2
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    107
    I'm not sure why your program would be crashing, but here is a link to a page that shows you how to add radio buttons to a dialog box:

    http://msdn.microsoft.com/library/de...Dialog_Box.asp

    If this doesn't bring you to the right page then enter Radio Buttons into the search box and click on the link for Grouping Radio Buttons on a Dialog Box.

    I hope this helps.

  3. #3
    Join Date
    Jun 2001
    Location
    Switzerland
    Posts
    4,443
    I can't tell why your program hangs, 'cause you provide too few details.
    Does MFC have a class for radio buttons such as CButton for normal buttons??
    Yes! It's called.......CButton . Serious, now: Use the GetCheck() / SetCheck() member functions to see whether the radio is selected ot not.
    Gabriel, CodeGuru moderator

    Forever trusting who we are
    And nothing else matters
    - Metallica

    Learn about the advantages of std::vector.

  4. #4
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    224
    Ok, i get a notification when the button is clicked:

    afx-messagemap:

    on_button_clicked(idc_radio_button_clicked, onradiobuttonclicked)
    ...

    then when implementing the onradiobuttonclicked the function is empty (until the stops hanging !)

    if i got you right, i could in this onradiobuttonclicked() function use the getcheck to see if it is checked or not. But since with the empty function the program hangs i expect it to hang too when i use getchecked.

    Tricky?
    CU

    Ingo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured