zoukankan      html  css  js  c++  java
  • C++ CheckListBox

     

     

    实现过程


        CCheckListBox    listbox1;

     

        listbox1.AddString("葡萄");
        listbox1.AddString("苹果");

        listbox1.AddString("桔子");

    //判断你选择了哪些项目

    void CCheckListBoxDlg::OnButtonOk() 
    {
        // TODO: Add your control notification handler code here
        CString strTextstrItem;
        int nSelCount = 0i = 0;
        
        strText = "您已经选择了:";
        int nCount = listbox1.GetCount();
        for(i = 0i < nCounti++)
        {
            if(listbox1.GetCheck(i))
            {
                nSelCount++;
            }
        }
        if(nSelCount <= 0)
        {
            AfxMessageBox("请选择一种水果。");
            return;
        }
        int nStep = 0;
        for(i = 0i < nCounti++)
        {
            if(listbox1.GetCheck(i))
            {
                listbox1.GetText(istrItem);
                strText += strItem;
                nStep++;
                if(nStep == nSelCount)
                {
                    strText += "。";
                }
                else
                {
                    strText += ",";
                }
            }
        }
        AfxMessageBox(strText);
    }

     

     


    备注

     

    关键点

     

    相关链接

    相关链接    相关链接

    相关链接    相关链接

     




    附件列表

    • 相关阅读:
      WebSocket
      Redis
      Memcached
      Python实现支付宝在线支付
      RabbitMQ
      linux内核优化
      kafka资源
      推荐相关
      机器学习好网站
      逻辑回归(logistic regression)的本质——极大似然估计
    • 原文地址:https://www.cnblogs.com/xe2011/p/3615740.html
    Copyright © 2011-2022 走看看