2 Star 0 Fork 1

codeman35/CodeTemplate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
FormValidate.cs 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
codeman35 提交于 2016-01-05 07:07 +08:00 . no commit message
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace AtfutureCodeMachine
{
public partial class FormValidate : Form
{
public FormValidate(string val,string yz)
{
InitializeComponent();
string[] arr = yz.Split(',');
this.clb_yz.Items.Clear();
foreach (string s in arr)
{
this.clb_yz.Items.Add(s);
}
for(int i=0;i<this.clb_yz.Items.Count;i++)
{
if (("," + val + ",").IndexOf("," + this.clb_yz.Items[i] + ",") != -1)
{
this.clb_yz.SetItemChecked(i, true);
}
}
}
/// <summary>
/// 返回值
/// </summary>
public string Value = "";
private void btnSelect_Click(object sender, EventArgs e)
{
for (int i = 0; i < this.clb_yz.Items.Count; i++)
{
if(this.clb_yz.GetItemChecked(i))
{
Value += "," + this.clb_yz.Items[i];
}
}
if (Value != "") Value = Value.Substring(1);
this.Close();
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/lxwcode/CodeTemplate.git
git@gitee.com:lxwcode/CodeTemplate.git
lxwcode
CodeTemplate
CodeTemplate
master

搜索帮助