随笔分类 -  C#

C#
遍历控件内控件
摘要:遍历返回的listCheckBox[] cl = GetLableList(tabPage1).ToArray<CheckBox>();foreach (CheckBox c in cl){ MessageBox.Show(c.Name);}传入控件检查空间内CheckBox添加到listprivate List<CheckBox> GetLableList(Control ctro) { List<CheckBox> list =new List<CheckBox>(); foreach (object var in ctro.... 阅读全文

posted @ 2011-08-11 10:35 小羽毛的天空 阅读(116) 评论(0) 推荐(0)

还是那个form的combox绑定
摘要:编辑器加载中... if (pid != "System.Data.DataRowView"){ DataSet dsc = bbc.GetList("fid=1"); cbPCFour.DataSource = dsc.Tables[0].DefaultView; cbPCFour.DisplayMember = "name"; cbPCFour.ValueMember = "Id";} 阅读全文

posted @ 2011-08-10 15:32 小羽毛的天空 阅读(123) 评论(0) 推荐(0)

将 datetimepicker 嵌入 bindingNavigator
摘要:需要知道form窗体有designer.cs和.cs两部分首先修改designer.cs中的内容引用using System.Windows.Forms;添加声明类publicclass ToolStripDateTimePicker : ToolStripControlHost { public ToolStripDateTimePicker() : base(new DateTimePicker()) { } }private void InitializeComponent() 中添加以下代码this.tsDataFrom =new Ba... 阅读全文

posted @ 2011-05-18 16:54 小羽毛的天空 阅读(305) 评论(0) 推荐(1)

日志
摘要:最近天天都在用的写日志方法很简单几句///<summary> /// 日志记录 ///</summary> ///<param name="itype">记录日志的类型(infom、debug、waring、error)</param> ///<param name="infom">日志等信息</param>publicstaticvoid WriteLog(string itype, string infom) { if (itype =="infom") { 阅读全文

posted @ 2011-05-18 11:43 小羽毛的天空 阅读(256) 评论(0) 推荐(0)

Form窗体的Combobox键值对绑定
摘要:Form窗体的Combobox键值对绑定privatevoid TestComboForm_Load(object sender, EventArgs e) { //打开时调用加载方法 ss(); } //声明ListItem CommonClass.ComboListItem.ListItem item =null; privatevoid comboBox1_SelectedIndexChanged(object sender, EventArgs e) { ... 阅读全文

posted @ 2011-05-18 11:40 小羽毛的天空 阅读(671) 评论(0) 推荐(0)

c#文件整理程序
摘要:自己写的一个整理硬盘文件的小程序简单些了一下还有很多错误没改正using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;namespace Fileclass{ publicpartialclass Form1 : Form { public Form1() { ... 阅读全文

posted @ 2011-05-09 16:19 小羽毛的天空 阅读(382) 评论(0) 推荐(0)