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);
    }

     

     


    备注

     

    关键点

     

    相关链接

    相关链接    相关链接

    相关链接    相关链接

     




    附件列表

    • 相关阅读:
      php 日期处理 DateTime
      http范围请求
      fiddle扩展
      汉字编码 (GB2312 GBK GB18030)
      Navicat http 通道增加验证
      vim 支持 nginx配置文件 语法高亮
      composer 使用
      剖析nsq消息队列(三) 消息传输的可靠性和持久化[一]
      剖析nsq消息队列(二) 去中心化源码解析
      剖析nsq消息队列(一) 简介及去中心化实现原理
    • 原文地址:https://www.cnblogs.com/xe2011/p/3615740.html
    Copyright © 2011-2022 走看看