how to find which button in a group is checked...

Hi,

I have a group of radio buttons (ID_R1, ID_R2, ..etc).  I want to know 
which button is checked.  This can be done easily if there is a dialog 
integer member variable associated with ID_R1 set in the dialog function 
DoDataExchange().  But could someone show me how to simplify the other 
often used approach to achieve the same purpose shown below?

    CButton *p = (CButton*) pDlg->GetDlgItem(IDC_R1);
    if (p->GetCheck() != 1)
    {
            // check through all the buttons
	   p = (CButton*) pDlg->GetDlgItem(IDC_R2);
	   if (p->GetCheck() != 1)
	   {
	   }
	   ...
    }
    else
    {
    }

Thanks for help.

Tony

0
tony6018 (73)
9/11/2003 12:37:26 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
399 Views

Similar Articles

[PageSpeed] 29

May Young wrote:
> 
> Hi,
> 
> I have a group of radio buttons (ID_R1, ID_R2, ..etc).  I want to know
> which button is checked.  This can be done easily if there is a dialog
> integer member variable associated with ID_R1 set in the dialog function
> DoDataExchange().  But could someone show me how to simplify the other
> often used approach to achieve the same purpose shown below?

int radio = GetCheckedRadioButton(ID_R1, ID_RLAST);

--
Scott McPhillips [VC++ MVP]
0
scottmcp (342)
9/11/2003 1:52:45 AM
Reply:

Similar Artilces:

Where can I find Brick wall in Visio?
Im looking to make a wall(brick wall!) but i can't find where's in Visio. On Sun, 26 Oct 2008 08:13:00 -0700, john15 <john15@discussions.microsoft.com> wrote: >Im looking to make a wall(brick wall!) but i can't find where's in Visio. It's well hidden. Open the Custom Patterns stencil menu File -> Shapes -> Visio Extras put a box type of shape on your page menu Format -> Fill and select the Brick pattern You may need to adjust the scaling. -- Regards, Paul Herber, Sandrila Ltd. http://www.electronics-packages.sandrila.co.uk/ Two other suggestion...

printing group header on each page
Hi, I have a report that is grouped and prints the group header on the first page of each group. There are multiple pages for each group. How can I get the group header to print on each page? Thanks, Steve Thanks, works like a charm. "Duane Hookom" wrote: > Set the Group Header's Repeat Section property to Yes. > > -- > Duane Hookom > Microsoft Access MVP > > > "Steve" wrote: > > > Hi, > > > > I have a report that is grouped and prints the group header on the first > > page of each group. There are multiple...

dpm 2010 hyper-v problem (Can't add hyper-v to protection group)
I have installed the RC for dpm 2010 and it is working great with the exception of 1 major problem. I cannot get a hyper-v machine added to any protection group. when I try to add it I get the following error message: One or more prerequisites for protecting this data source is missing: kb: 948465 (windows 2008 service pack 2 - which is installed) kb: 971394 - which is installed I could list the prerequisites, however I know that is not the problem. I have verified all prerequisites exist on the host machine. The only other knowledge base article I can find recommends ...

Spell check unavailable in Putlook Express 6.0
The Spell Check option is greyed out Outlook Express. The OS is XP and machine Dell Inspiron laptop. Does anyone have an idea how to get this installed? I understand the same spell checker also works in MS Office (Word). When I go into Tools and Options Spelling isn't among the options. Any ideas? vlakslee <anonymous@discussions.microsoft.com> wrote: > The Spell Check option is greyed out Outlook Express. The > OS is XP and machine Dell Inspiron laptop. Does anyone > have an idea how to get this installed? I understand the > same spell checker also works in M...

Where can I find a nice Book Template for use with WORD 2003?
I want to write a book using WORD 2003 and I would like to find a nice template to use. Is there anything available for free out there? Thanks in advance! See http://daiya.mvps.org/bookword.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Proshome" <Proshome@discussions.microsoft.com> wrote in message news:2654F873-2CAB-4811-8913-716CB14270B6@microsoft.com... >I want to write a book using WORD 2003 and I would like to find a nice > template to use. Is there anything available for free out...

Check out these corrective patch
--nkavurxrpm Content-Type: multipart/related; boundary="peqyyedikryjy"; type="multipart/alternative" --peqyyedikryjy Content-Type: multipart/alternative; boundary="nvrinnuh" --nvrinnuh Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Consumer this is the latest version of security update, the "November 2003, Cumulative Patch" update which eliminates all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to contin...

Global Find and Replace function
I would like to be able to perform a global find and replace function across my contacts folder, specifically in the email field. Any way this can be done short of exporting to a CSV and then reimporting back into Outlook? This may be of interest ContactGenie Toolkit - http://www.contactgenie.com/cgtoolkit.htm (one of the 24 + functions is global search & replace on any text field including domain related functions specific to email & web addresses) Karl ____________________________________________________________ Karl Timmermans - The Claxton Group ContactGenie - Imp...

tab scrolling buttons missing
I can't get the tab scrolling or worksheet buttons to appear on my view when using excel 2007. Help? Use Tools | Options; open the View tab; look at your settings in the Windows Option area. best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "TomG" <TomG@discussions.microsoft.com> wrote in message news:2F2A93E7-77A8-4065-9646-B1A30A1AE806@microsoft.com... >I can't get the tab scrolling or worksheet buttons to appear on my view >when > using excel 2007. Help? ...

Counting dates within groups
Hi Is it at all possible to calculate or count groups of dates in a lis when they have a gap of 2 days between them? It's kind of hard to explain The attachment has the data I'm trying to work from including description of the result. Cheers Joe Attachment filename: timesheet test.xls Download attachment: http://www.excelforum.com/attachment.php?postid=56391 -- Message posted from http://www.ExcelForum.com ...

How do I find the MSXML version?
How can I find what MSXML version I have installed? -- Thanks Sharon Sharon wrote: > How can I find what MSXML version I have installed? You can have several version (e.g. 3, 4, 5, 6) installed side by side. As for the version IE 6 or IE 7 uses to parse XML load e.g. <http://home.arcor.de/martin.honnen/xslt/processorTest.xml> and check its output, it should show msxsl:version 3 This article <http://support.microsoft.com/kb/269238/en-us> might also help. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ Your link is not very helpful. As long as you have ...

Find if nth char = specific character..
hi, trying to find way to see if 5th character equals the letter A. know / tried: len( or right( but item tested may have more than 5 characters. Thanks. Hi, Try the MID function. =MID(A1,5,1)="A" Cheers Andy nastech wrote: > hi, trying to find way to see if 5th character equals the letter A. > know / tried: len( or right( but item tested may have more than 5 > characters. Thanks. -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info =IF(MID(A1,5,1)="A","yes","no") -- HTH RP (remove nothere from the email addr...

"Find" window not opening in word 2007
I have an issue with the "find" window not opening. It seems to be only affecting one computer on xp. As the find function works on that document if I edit on another PC. I have already tried deleting the normal.dotm file. It worked once then back to same issue. When I select ctrl + f or actually click on the find button on the home tab, word seems to gray out as if the find window is open somewhere, but I can find it. This is completely frustrating. Any help would be greatly appreciated. If you start Word in Safe mode, then does it work? To start in Safe mode, hold C...

Submit button to email for request form to be approved/denied
Hello everyone, I sent a message earlier about the submit button in access. What I have designed is a form that a user can go into and enter information then once they hit the submit button it will go to the specified email address but I don't particularly know how to code it. The way it is designed I think I would have to have different forms so that the user can submit it then it will go to another form. The approving parties will approve or deny the request then submit the information back, then that email will shoot back to the user who requested approval. Can anyone help me on...

Where can I find leaflet templates for publisher 2000?
Hi, I am a novice publisher user and I am trying to create a great leaflet, more along the lines of what is availble for Publisher 2003 rather than 2000. Iwas wondering if anyone knows where I could find some! Many thanks File, new, select flyers, you can see a sample leaflet. Create a great leaflet with your imagination. Only you know the content... -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "alexhart" <alexhart@discussions.microsoft.com> wrote in message news:1E548E43-B1CF-44A4-BF6A-BDDD89B1CB47@microsoft....

Check email in outbound queue
I have a suspect message waiting delivery. Luckily my Exchange server cant resolve the destination. I froze it in the queue, and I'd like to view the message. It was sent from postmaster(my account I assume). Anyone know how to view it, it's not listed in anyones Outbox or Sent Items Thanks. If you are using Exchange 5.5 then open file in IMCDATA\OUT with notepad. Jim wrote: > I have a suspect message waiting delivery. Luckily my Exchange server cant resolve the destination. I froze it in the queue, and I'd like to view the message. It was sent from postmaster(my account I a...

exchange administrator can't find exchange server
I recently had a systems crash and now the exchange administrator can't find the exchange server. The OS is NT4 with various service packs installed. Does anyone know how to fix this problem? Though there is not much detail in your description... How are your WINS servers? How are your DNS servers? Are the records for the Exchange boxes in WINS and DNS? Bob "Dave" <anonymous@discussions.microsoft.com> wrote in message news:895a01c4855e$c4247480$a401280a@phx.gbl... > I recently had a systems crash and now the exchange > administrator can't find the exchange...

Can emails be sent on behalf of a distribution group?
Hello, Our company needs to set up an email notification mechanism for informing our customers of upcoming events. The emails must originate from events@mycompany.com. Customers must RSVP to events@mycompany.com. Any email that is received on events@mycompany.com must be redirected to a few selected users. I created "events" as an email-enabled global distribution group. I also went ahead and added "Full Control" security for some of the users (including myself) so that "send as" can work for these users. Now, when an email is sent to events@mycompany.com, all ...

Recovery Storage Group vs Brick level backup
I have read that brick level backups are not extremely reliable and from first hand use are extremely slow. I have read that by using a recovery storage group you can accomplish the same thing be restoring the whole store, exporting the mailbox (exmerge) and then recovering the mailbox. Is the RSG the recommended way to backup mailboxes and recover them? If so do I set up a RSG ahead of time or just in the event that I need to recover a mailbox? I am using exchange 2003 Ent, Windows 2003 Server and Veritas BE 9.1. Thanks. RSGs are great...my preferred method of recovering items that...

Hiding "Create Quick Campaign" button
Hi, Can anybody help me on hiding the button in Account entity. I want to hide "Create quick Campaign" button in Account Record. Thank You Vinod Hi VP, Through scripts it is possible to hide the button. Write the following code in the onload event of the account form. document.all.<controlname>.style.display = "none"; where controlname is the name of Create Quick Campaign button on the CRM form. To find the name of the control press Ctrl + N on the account form. This will open the account form in another IE window with menu. Click view source to open the h...

Spin Buttons / Forms / Excel
Spin buttons, a tool within forms, once used and measurements are changed by utilising this, disappear from the worksheet. These spin buttons do not reappear until the space where the object was inserted is changed again with the cursor to alter the measurement. Then they disappear again, any ideas? 1. Ctrl +Right click to get FormatControl/Properties "Do not move o resize with Cells" (? -- Message posted from http://www.ExcelForum.com ...

Delete Direct Deposit Payroll Check
Question from our payroll master: " I need to void one direct deposit entry from payroll and reissue. The ACH file has been created for the whole payroll and the file is waiting to be transmitted to the bank. The ACH build for this file has already been deleted - What is the process?" One person, who has her check direct deposited, didn't have the correct 401K deduction and the payroll master would like to know the procedure to delete this person's information from the ACH file (we know it can't and shouldn't be done manually and that we can call our bank to...

Warning: skipping non-radio button in group
Hi Al i built an mfc application the basic dialog include two radio buttons three Buttons and some picture when im running my application under debug mode i gor the following message "Warning: skipping non-radio button in group" how can i fix this problem and what the reason that its show up? Thank Gabi Gabi wrote: > Hi All > i built an mfc application. > the basic dialog include two radio buttons three Buttons and some picture. > when im running my application under debug mode i gor the following message: > "Warning: skipping non-radio button in group". &...

Freeze fields with a command button click
How would I lock multiple fields so a user can not change based on a click of a button. There is a date field so once it hit month end I would like to freeze a user from changing the record. How is that possible? Thanks PJ wrote: >How would I lock multiple fields so a user can not change based on a click of >a button. There is a date field so once it hit month end I would like to >freeze a user from changing the record. How is that possible? > >Thanks Note that you cannot lock anything at table level. If the user has access to update/delete queries tha...

Update Installer not finding Office to install to!
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have Office 2008 installed, complete with the previous 3 updates, 1201,1210,1211, all of which installed with no bother at all. I have downloaded 1212, and the installer cannot find a valid volume to install to. All my volumes, including the one with Office installed and updated previously, come up with exclamation marks in the installer window, and when I click on my startup volume in that window I get the message: You cannot install Office 2008 12.1.2 Update on this volume. A version of the software required to inst...

Find container BackColor
Hi. I need to find Control(parent) backcolor, the control was Image control. If parent was Form i use Control Section property: GetParentBackColor =Me.Section(objControl.Section).BackColor If my control was located on TabControl i presume i've to test BackStyle property =Trasparent(this was OK). In this case i get TabControl Section BackClor... may be right. but if BackStyle was not Trasparent... how can i find SystemColor used for TabControl or real color show by system...? I Loop trought all 24 SystemBrushcolor, but i can't find the real color i need... Any suggest will be pre...