程序窗体和对话框

1、消息对话框换行:Enviroment.NewLine
2、设置文件对话框的筛选器:"图像文件(Jpeg,Gif,Bmp,etc) | *.jpg;*.jpeg | 所有文件 *.* (*.*)"
3、在上次关闭位置启动程序窗体
  //设置窗体启动位置
  RegisterKey MyFirstReg,MyReg;
  MyFirstReg = Registry.CurrentUser;
  try
  {
    MyReg = MyFirstReg.CreateSubKey("software\\MySort");
    this.Location = new Point(Convert.ToInt16(MyReg.GetValue("1")),Convert.ToInt16(MyReg.GetValue("2")));
  }
  catch
  {}
  //保存窗体关闭位置
  RegisterKey MyFirstReg,MyReg;
  MyFirstReg = Registry.CurrentUser;
  MyReg = MyFirstReg.CreateSubKey("software\\MySort");
  try
  {
    MyReg.SetValue("1",this.Location.X.ToString());
    MyReg.SetValue("2",this.Location.Y.ToString());
  }
  catch
  {}

转载于:https://www.cnblogs.com/changweihua/archive/2011/08/25/2152701.html

你可能感兴趣的:(程序窗体和对话框)