Win32 Radio Button Code for Visual C++ | No MFC

  • Context: C/C++ 
  • Thread starter Thread starter 31si
  • Start date Start date
  • Tags Tags
    Radio
Click For Summary
SUMMARY

The discussion focuses on retrieving the checked state of a radio button in Visual C++ without using Microsoft Foundation Classes (MFC). A user shares their approach by declaring a CButton member object named m_MyRadio within a dialog. The method m_MyRadio.GetCheck() is confirmed as the correct way to check if the radio button is selected. This solution provides a straightforward method for developers working with Win32 API in Visual C++.

PREREQUISITES
  • Familiarity with Visual C++ programming
  • Understanding of Win32 API
  • Knowledge of dialog-based applications in Visual C++
  • Basic understanding of CButton class in Visual C++
NEXT STEPS
  • Explore Win32 API for creating user interfaces
  • Learn about handling control events in Visual C++
  • Investigate the CButton class and its methods
  • Study examples of dialog-based applications without MFC
USEFUL FOR

Visual C++ developers, particularly those working with Win32 API and seeking to implement user interface elements without MFC.

31si
Messages
21
Reaction score
0
Hello

I have googled to no avail. I am after the code to retrieve if a radio box is checked or not in Visual C++. I am not using MFC which all of the tutorial on the internet do. Any ideas? A few pointers in the right direction possibly?
 
Technology news on Phys.org
I always bind my controls to a class member. If I declared a CButton member object in my dialog named m_MyRadio, then:

m_MyRadio.GetCheck ();

will do the trick.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
9
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 25 ·
Replies
25
Views
15K
  • · Replies 6 ·
Replies
6
Views
12K