输出字符串格式化/ Linq对数组操作 /一个按钮样式
textBox1.Text = dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss");
int[] arr = { 100, 20, 2, 4, 104, 1, 21, 101, 102, 201, 202 }; var data = arr.Where(n => n % 2 == 0 && n > 100).OrderByDescending(n => n); foreach (var x in data) { Console.WriteLine(x); } Console.ReadKey();
// // button1 // this.button1.BackColor = System.Drawing.SystemColors.Window;//背景色 this.button1.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));//边框颜色 this.button1.FlatAppearance.BorderSize = 2;//边框大小 this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Blue;//鼠标按下背景 this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));//鼠标停留背景色 this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;//平面样式 this.button1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));//字体 this.button1.Location = new System.Drawing.Point(53, 64);//位置 this.button1.Name = "button1"; //设计名字 this.button1.Size = new System.Drawing.Size(130, 34); //大小 this.button1.TabIndex = 4; //索引 tab键 this.button1.Text = "登录"; //显示名称 this.button1.UseVisualStyleBackColor = false; //使用视觉样式背景色 默认