mfc radio button to set the default selected

2011-03-19  来源:本站原创  分类:OS  人气:134 

We assume that there are two RADIO controls: IDC_RADIO_SINGLE and IDC_RADIO_RANGE, our aim is the default selection IDC_RADIO_SINGLE control.

Method One:

CheckRadioButton (IDC_RADIO_SINGLE, IDC_RADIO_RANGE, IDC_RADIO_SINGLE);

Method Two:

There will be IDC_RADIO_SINGLE Group property set, IDC_RADIO_RANGE not;

CTRL + Double-click IDC_RADIO_SINGLE button to add a member variable m_Radio;

RADIO initialization to add the following code:

m_Radio = 0;

UpdateData (FALSE);

Method three:

CButton * radio = (CButton *) GetDlgItem (IDC_RADIO_SINGLE);

radio-> SetCheck (1);

The third method is still popular Oh. This is one of the methods commonly used in access control.

相关文章
  • mfc radio button to set the default selected 2011-03-19

    We assume that there are two RADIO controls: IDC_RADIO_SINGLE and IDC_RADIO_RANGE, our aim is the default selection IDC_RADIO_SINGLE control. Method One: CheckRadioButton (IDC_RADIO_SINGLE, IDC_RADIO_RANGE, IDC_RADIO_SINGLE); Method Two: There will b

  • MFC questions to group the radio button 2010-07-13

    On the radio button group: Each of the first radio button to set the property: Group, Tabstop, Auto; the other buttons to set the property Tabstop, Auto. Such as: Radio1, Radio2, Radio3 as a group, Radio4, Radio5 for a group Set Radio1 properties: Gr

  • vc + + how to make the radio button, checkbox is initially selected state? 2010-12-29

    CheckDlgButton (IDC_CHECK1, BST_UNCHECKED); / / 0 CheckDlgButton (IDC_CHECK2, BST_CHECKED); / / 1 ((CButton *) GetDlgItem (IDC_RADIO_1)) -> SetCheck (1); Can also use the class wizard will bind to the control variables, set the initial value, and the

  • MFC中Radio Button的用法详解 2013-12-08

    这篇文章主要介绍了MFC中Radio Button的用法,需要的朋友可以参考下 本文通过针对两个常见问题的解决方案,详细阐述了MFC中Radio Button的用法.有助于读者加深对于MFC运行机制及Radio Button控件用法的理解. 首先为对话框加上2个radio button,分别是Radio1和Radio2. 问题1:如何让Radio1或者Radio2默认选上?如何知道哪个被选上了? 关键是选上,"默认"只要放在OnInitDialog()即可.有如下的三种方法可以让它选上

  • MFC 中 Radio Button 使用方法 2014-08-16

    先为对话框加上2个radio button,分别是Radio1和Radio2. 问题1:如何让Radio1或者Radio2默认选上?如何知道哪个被选上了? 关键是选上,"默认"只要放在OnInitDialog()即可.三种方法可以让它选上, 第一种: ((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(TRUE);//选上 ((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(FALSE);//不

  • [Reproduced] js detected radio button to select 2009-09-15

    When the <input type="radio" name="radio_name" value="radiobutton"> (radio button) is a dynamic join the page, it is possible for the number of 0,1, or greater than 1, and therefore need to js to determine when the radi

  • [Change] progressive realization of imitation QQ interface (4): radio button and from the drawing toolbar 2010-03-19

    This one should have demonstrated how to implement the interface in the middle of imitation QQ client area and the bottom of the toolbar, but the bottom toolbar in the realization of the time found that the radio button and from the drawing toolbar,

  • jquery implementation of the check box and radio button Select the value 2010-06-01

    Below we first give Select code: html code: <input type="checkbox" name="checkbox_name[]" /> 1 <br /> <input type="checkbox" name="checkbox_name[]" /> 2 <br /> <input type="checkbox&q

  • Struts2's <s:radio/> default selected value solution 2010-08-13

    Struts2's <s:radio/> default selected value solution Two ways: 1, face value when the string <s:radio list="{ 'XXX':' Search for data by Job No. ', 'productNo': ' Press ISBN search data '}" name="radField" value="'XXX' &q

  • Click the radio button to select the radio after the radio button text 2011-05-31

    Keywords: radio radio button selected text Sometimes we fill out some forms in Web pages, you may encounter the radio button, if you select the gender is male or female, then customers tend to click the radio button that little circle, as a single Se

  • Check radio button with text alignment study and solve the problem 2010-04-01

    Abstract: English text above the current site, on my personal feelings, the vast majority of the mainstream site text size 12px, because under the present high-resolution display screen, 11px of Chinese characters, the beginning of its pixels are not

  • Create radio button Swing 2010-04-29

    1. Import javax.swing.JFrame; 2. Import javax.swing.JRadioButton; 3. Import javax.swing.JLabel; 4. Import javax.swing.BoxLayout; 5. Import javax.swing.ButtonGroup; 6. Import java.awt.Container; 7. Import java.awt.event.ActionListener; 8. Import java.

  • lwuit radio button group event listener failure? 2010-07-19

    In my current main panel form1 there is a TABLE is a radio button form the first column, followed by several column is the business field. Now, I record the radio in which any one business, click on the bottom right corner of the menu "View Details&q

  • Click the radio button to hide the drop-down options 2010-07-20

    <% @ Page language = "java" pageEncoding = "UTF-8"%> <% String path = request.getContextPath (); String basePath = request.getScheme () + "://" + Request.getServerName () + ":" + request.getServerPort () +

  • radio button javascript get value (Reprinted) 2010-10-14

    Original: javascript to get value of radio button Javascript code var cslb = ""; / / Get the value of radio buttons var radios = document.getElementsByName ("cslb"); for (var i = 0; i <radios.length; i + +) { if (radios [i]. checked

  • Radio Button With UIKit 2012-07-06

    Radio Button With UIKit 网站 : https://github.com/t4ku/RadioButtonWithUIKit 实现单选按钮效果. [Code4App.com] 授权协议: 未知 开发语言: Objective-C 操作系统: iPhone/iPad/iPod

  • JS radio button selected dynamic data 2010-12-18

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untit

  • JS to determine the radio button at the page to submit FORM has been selected before 2009-03-17

    <script language="javascript"> function Check () ( var checkNum = 0; for (i = 0; i <document.form1.t1.length; i + +) ( if (document.form1.t1 [i]. checked) ( checkNum + +; ) ) if (checkNum == 0) ( return false; ) else ( return true; ) )

  • Radio button check box to add an event 2010-06-20

    <%@page contentType="text/html" pageEncoding="UTF-8"%> <% request.setAttribute("base", request.getContextPath()); %> <html> <head> <meta http-equiv="Content-Type" content="text/html;

  • jQuery get and set the radio button. check box. text box contents 2010-07-05

    Get a group of selected items of the value of the radio var item = $ ('input [@ name = items] [@ checked]'). val (); Access to select the text of the selected items var item = $ ("select [@ name = items] option [@ selected]"). text (); select th