|
-
April 17th, 1999, 01:59 AM
#1
Radio Buttons, and Edit boxes
Hi,
I have a dialog with two radio buttons, and next to each button, there a readonly editbox.
What I want is that if a radoi button has been selected, then the edit box must be writable, and the focus must be on this edit box.
I don't know how to do this, and would appreciate any help/advice.
Any code would also help.
Thanks is advance.
Cheers.
==============================================
Allen Van Der Ross
Systems Programmer
Software Performance Improvement
South Africa
E-Mail: [email protected]
==============================================
-
April 17th, 1999, 02:31 AM
#2
Re: Radio Buttons, and Edit boxes
You need to create a message handler (BN_CLICKED) for the desired radio button. For example: the OnRadioClicked() will handle the BN_CLICKED message for your radiobox and the editbox's ID is IDC_MYEDITBOX.
OnRadioClicked()
{
// TODO: Add your control notification handler code here
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_MYEDITBOX);
ASSERT(pEdit != NULL);
pEdit->SetReadOnly(FALSE); // set it to be read/write
pEdit->SetFocus(); // set the focus to the editbox
}
Hope this will help. Good luck.
Lynx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|