曹永思

导航

C# 打开选中文件或文件夹 、窗体居中等

  //用资源管理器打开C:\
  System.Diagnostics.Process.Start( "explorer.exe ",   "C:\ ");
  System.Diagnostics.Process.Start( "C:\ Temp");
 
   /// <summary>
        /// 窗体居中
        /// </summary>
        /// <param name="form"></param>
        public static void SetMid(Form form)
        {
            form.SetBounds((Screen.GetBounds(form).Width / 2) - (form.Width / 2)
                , (Screen.GetBounds(form).Height / 2) - (form.Height / 2)
                , form.Width, form.Height, BoundsSpecified.Location);
        }

posted on 2012-08-27 00:28  曹永思  阅读(330)  评论(0编辑  收藏  举报