03 2020 档案

摘要:2020-03-31 每日一例第23天 1.新建对话框,拖label/textbox控件; 2.后台代码; private void textBox1_TextChanged(object sender, EventArgs e) { //输入字符转数组 char[] p_char = text1. 阅读全文
posted @ 2020-03-31 22:56 winnerljs 阅读(465) 评论(0) 推荐(0)
摘要:2020-03-30 每日一例第22天 1.新建对话框,拖label/textbox/button控件; 2.后台代码; //声明字段 StringBuilder sb = new StringBuilder(text1.Text); //遍历 for (int i = 0; i < sb.Leng 阅读全文
posted @ 2020-03-30 23:27 winnerljs 阅读(3211) 评论(0) 推荐(0)
摘要:2020-03-30 每日一例第21天 1.新建对话框,拖label/textbox控件; 2.后台代码; public string GetABC(string str) { Regex reg = new Regex("^[\u4e00-\u9fa5]$"); byte[] arr = new 阅读全文
posted @ 2020-03-30 00:06 winnerljs 阅读(698) 评论(2) 推荐(0)
摘要:2020-03-28 每日一例第20天 string fileName = @"D:\music\1.mp3"; //文件是否存在if (File.Exists(fileName)){ //删除文件File.Delete(fileName);} 阅读全文
posted @ 2020-03-28 23:24 winnerljs 阅读(5261) 评论(0) 推荐(0)
摘要:2020-03-28 每日一例第19天 string fileName = @"D:\music\1.mp3"; //文件是否存在 if (File.Exists(fileName)) { Console.WriteLine("{0}文件存在", fileName); Console.ReadKey 阅读全文
posted @ 2020-03-28 01:43 winnerljs 阅读(3818) 评论(0) 推荐(0)
摘要:2020-03-26 每日一例第18天 1)使用"+"拼接string字符串 string str = string.Empty; str = "a"; str = str + "b"; str = str + "c"; str = str + "d"; str = str + "e"; Conso 阅读全文
posted @ 2020-03-26 22:00 winnerljs 阅读(4488) 评论(0) 推荐(0)
摘要:2020-03-26 每日一例第17天 string str = "abcdefg"; string str1 = str.Replace("a","0"); Console.WriteLine(str1); Console.ReadKey(); 阅读全文
posted @ 2020-03-26 00:11 winnerljs 阅读(438) 评论(0) 推荐(0)
摘要:2020-03-25 每日一例第16天 1.新建对话框,拖timer1/dateTimePicker1; 2.代码; a.窗体加载时代码: timer1.Interval = 1000; dateTimePicker1.Value = DateTime.Parse("2015-01-01 00:00 阅读全文
posted @ 2020-03-25 00:32 winnerljs 阅读(1223) 评论(0) 推荐(0)
摘要:2020-03-23 每日一例第15天 1.新建对话框,拖Textbox/label/button; 2.“选择字体”按钮代码; FontDialog ff = new FontDialog(); if (ff.ShowDialog()==DialogResult.OK) { text4.Text 阅读全文
posted @ 2020-03-23 23:37 winnerljs 阅读(1776) 评论(0) 推荐(0)
摘要:2020-03-23 每日一例第14天 1.新建对话框,拖Textbox/label/button; 2.“保存文件”按钮后的代码; SaveFileDialog sf1 = new SaveFileDialog(); //设置对话框标题 sf1.Title = "保存导出文件"; //设置默认文件 阅读全文
posted @ 2020-03-23 00:23 winnerljs 阅读(9528) 评论(0) 推荐(1)
摘要:2020-03-22 每日一例第13天 1.新建对话框,拖Textbox/label/button; 2.“选择文件”按钮后的代码; OpenFileDialog op1 = new OpenFileDialog(); op1.Title = "选择数据文件"; op1.Filter = "所有文件 阅读全文
posted @ 2020-03-22 00:11 winnerljs 阅读(352) 评论(0) 推荐(1)
摘要:2020-03-21 每日一例第12天 1.常用属性 Name:名称; BackColor:设置控件背景颜色; BorderStyle:文本框样式; ContextMenuStrip:绑定右键弹出菜单; Dock:在父容器中的停靠方式; Enabled:是否可用; ForeColor:文字颜色; L 阅读全文
posted @ 2020-03-21 00:26 winnerljs 阅读(2996) 评论(0) 推荐(0)
摘要:2020-03-19 每日一例第11天 1.常用属性 Name:名称; BackColor:设置控件背景颜色; Enabled:是否可用; FlayStyle:控件样式; Image:设置控件图像; ImageAlign:图像对齐方式; ImageList:图像ImageList索引值; Locat 阅读全文
posted @ 2020-03-20 00:15 winnerljs 阅读(2884) 评论(0) 推荐(0)
摘要:2020-03-18 每日一例第10天 1.常用属性 Name:名称; Text:标题; Font:字体; Windowstate:状态;默认/最大化/最小化 Opacity:透明度; Maximizebox:最大化; Minimizebox:最小化; Ismidcontainer:该窗体是否MDI 阅读全文
posted @ 2020-03-19 00:16 winnerljs 阅读(3408) 评论(0) 推荐(0)
摘要:2020-03-17 每日一例第9天 1.新建窗体应用程序:窗体1,拖入label/textbox/button控件,并改text值; 2.新建窗体应用程序:窗体2,拖入label控件,并改text值; 3.新建一个类,类中创建一个静态字段; 类中代码: public class username 阅读全文
posted @ 2020-03-18 00:25 winnerljs 阅读(3406) 评论(0) 推荐(0)
摘要:2020-03-16 每日一例第8天 1.新建窗体应用程序,拖入label/textbox/radiobutton控件,并改text值; 2.button控件输入代码; if (radioButton1.Checked) { textBox2.Text = textBox1.Text.ToUpper 阅读全文
posted @ 2020-03-16 23:41 winnerljs 阅读(4832) 评论(0) 推荐(0)
摘要:2020-03-15 每日一例第8天 1.新建窗体应用程序,拖入label/textbox控件,并改text值; 2.textBox1的KeyPress属性,并输入代码; if (!Char.IsDigit(e.KeyChar)) { MessageBox.Show("请输入数字","提示",Mes 阅读全文
posted @ 2020-03-16 00:04 winnerljs 阅读(395) 评论(0) 推荐(0)
摘要:2020-03-14 每日一例第7天 1.新建窗体windowform,修改text值; 2.两个按钮后台代码: private void button1_Click(object sender, EventArgs e) { //转为字符串 textBox1.PasswordChar =(char 阅读全文
posted @ 2020-03-14 23:52 winnerljs 阅读(1056) 评论(0) 推荐(0)
摘要:2020-03-13 每日一例第6天 1.新建窗体windowform,修改text值; 2.找到mouseclick事件,填写代码; Random rm = new Random(); Button bt = new Button() { Text = "冬天按钮生成器", ForeColor = 阅读全文
posted @ 2020-03-13 23:58 winnerljs 阅读(514) 评论(0) 推荐(0)
摘要:2020-03-12 每日一例第5天 1.添加按钮1和label、textbox控件,并修改相应的text值; 2.修改textBox1的TextChanged事件并输入代码; button1.Text = textBox1.Text;//赋值button文本 button1.AutoSize = 阅读全文
posted @ 2020-03-13 00:56 winnerljs 阅读(760) 评论(0) 推荐(0)
摘要:2020-03-11 每日一例第4天 1.添加按钮1-6,并修改相应的text值; 2.窗体Load事件加载代码; private void Form1_Load(object sender, EventArgs e) { //前景色为红色 button1.ForeColor = Color.Red 阅读全文
posted @ 2020-03-11 23:57 winnerljs 阅读(236) 评论(0) 推荐(0)
摘要:2020-03-11 每日一例第3天 1.设置父窗体属性;IsMdicontainer设置成true; 2.拖入menustrip控件,修改标题栏中的text文字。 3.点击“加载子窗体”设置代码: Form frm1 = new Form(); frm1.MdiParent = this; frm 阅读全文
posted @ 2020-03-10 00:05 winnerljs 阅读(1285) 评论(0) 推荐(0)
摘要:1.新建父窗体,设置窗体属性:IsMdicontainer设置成true; 2.拖入button控件,修改button中的text。 3.点击button控件设置代码: //1.窗体实例化 Form frm = new Form(); //2.设置所属父窗体 frm.MdiParent = this 阅读全文
posted @ 2020-03-08 23:51 winnerljs 阅读(1257) 评论(0) 推荐(0)