how can i make radio button appear selected by default

hi
i have three radio button .. forming a radio button group... i want that when my application starts .. i mean at execution... my first radio button must appear selected....

i hav tried CButton::setCheck funtin .. but as i read on msdn .. they were working like ..making a new CButon abject and then calling setcheck with it... but here how can i do this.. as i m new in mfc
... so plz help me with this problem
regardss
ali hammad

Comments

  • : hi
    : i have three radio button .. forming a radio button group... i want that when my application starts .. i mean at execution... my first radio button must appear selected....
    :
    : i hav tried CButton::setCheck funtin .. but as i read on msdn .. they were working like ..making a new CButon abject and then calling setcheck with it... but here how can i do this.. as i m new in mfc
    : ... so plz help me with this problem
    : regardss
    : ali hammad
    :

    look in the dialog's class constructor and change the value from -1 to 0.

    [code]
    CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
    : CDialog(CMyDialog::IDD, pParent)
    {
    [green] //{{AFX_DATA_INIT(CMyDialog)[/green]
    [red] m_option = -1;[/red][blue]<<< change this to 0[/blue]
    [green] //}}AFX_DATA_INIT[/green]
    }

    [/code]
  • : : hi
    : : i have three radio button .. forming a radio button group... i want that when my application starts .. i mean at execution... my first radio button must appear selected....
    : :
    : : i hav tried CButton::setCheck funtin .. but as i read on msdn .. they were working like ..making a new CButon abject and then calling setcheck with it... but here how can i do this.. as i m new in mfc
    : : ... so plz help me with this problem
    : : regardss
    : : ali hammad
    : :
    :
    : look in the dialog's class constructor and change the value from -1 to 0.
    :
    : [code]
    : CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
    : : CDialog(CMyDialog::IDD, pParent)
    : {
    : [green] //{{AFX_DATA_INIT(CMyDialog)[/green]
    : [red] m_option = -1;[/red][blue]<<< change this to 0[/blue]
    : [green] //}}AFX_DATA_INIT[/green]
    : }
    :
    : [/code]
    :

    thank you very much Mr.stober.. u have solved my problem

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories