摘要: 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;using System.Diagnostics;namespace HYInstall{ public partial class Form1 : Form { string Current = Directory.GetC... 阅读全文
posted @ 2012-12-06 14:57 Asa.Zhu 阅读(239) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Text.RegularExpressions;usingSystem.Windows.Forms;usingSystem.Net;namespaceWindowsFormsApplication1{publicpartialclassForm1:Form{publicForm1(){Ini 阅读全文
posted @ 2012-12-06 14:55 Asa.Zhu 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Microsoft.VisualBasic.dll 引用using Microsoft.VisualBasic;String PM = Interaction.InputBox("请输入密码", "输入密码", "", 100, 100); if (PM != "123456") { MessageBox.Show("请输入正确的密码谢谢!!!!!"); return; } 阅读全文
posted @ 2012-12-06 14:54 Asa.Zhu 阅读(12493) 评论(1) 推荐(0) 编辑
摘要: private static Form2 f2=null;private static Form3 f3 = null;private void button1_Click(object sender, EventArgs e) { if (f3 != null) { f3.Hide(); } if (f2== null) { f2 = new Form2(); f2.TopLevel = false; f2.Parent = this.panel3; f2.Show(... 阅读全文
posted @ 2012-12-06 14:54 Asa.Zhu 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 本次示例效果如下:Form1为父窗体(包含textBox1、button1)Form2为子窗体(包含textBox2、button2)父窗体给子窗体传值==================1.点击Form1的button1 打开Form2 父窗体给子窗体传值 可以调用重载子窗体的构造函数 直接传入相关数值 public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Form2 frm2 阅读全文
posted @ 2012-12-06 14:53 Asa.Zhu 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 记性不好,就写下来。这个问题浪了我不少时间,希望不要再浪费其他人的时间了。1.FrmParent.csprivate void Button1_Click(object sender, EventArgs e) { FrmChild frmChild = new FrmChild(); frmChild .parentFrm = this; frmChild .ShowDialog(); }public void TestFunction(){MessageBox.show("这个是父窗体的函数");}2.FrmChild.csForm parentFrm ;private 阅读全文
posted @ 2012-12-06 14:53 Asa.Zhu 阅读(744) 评论(0) 推荐(0) 编辑
摘要: RowHeadersVisible = false 阅读全文
posted @ 2012-12-06 14:42 Asa.Zhu 阅读(214) 评论(0) 推荐(0) 编辑
摘要: C#使用udl连接数据库示例1、OleDbConnection oleconn = new OleDbConnection();oleconn.ConnectionString = @"File Name ="+Application.StartupPath+"\chis.udl";OleDbCommand olecommand = new OleDbCommand();olecommand.Connection = oleconn;olecommand.CommandText = "select * from mz_patient_mi&qu 阅读全文
posted @ 2012-12-06 14:28 Asa.Zhu 阅读(2642) 评论(0) 推荐(0) 编辑
摘要: if (System.IO.Directory.Exists("D:/notes")) { String[] year = Directory.GetDirectories("D:/notes/"); String[] file = Directory.GetFiles("D:/notes/");} 阅读全文
posted @ 2012-11-08 23:02 Asa.Zhu 阅读(546) 评论(0) 推荐(0) 编辑
摘要: //消息框中需要显示哪些按钮,此处显示“确定”和“取消”MessageBoxButtons messButton = MessageBoxButtons.OKCancel;//"确定要退出吗?"是对话框的显示信息,"退出系统"是对话框的标题//默认情况下,如MessageBox.Show("确定要退出吗?")只显示一个“确定”按钮。DialogResult dr = MessageBox.Show("确定要退出吗?", "退出系统", messButton);if (dr == DialogRe 阅读全文
posted @ 2012-11-08 21:43 Asa.Zhu 阅读(92493) 评论(0) 推荐(1) 编辑