try { DialogResult AuthenticationDialog = MessageBox.Show("您是否要退出软件?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information); switch (AuthenticationDialog) { case System.Windows.Forms.DialogResult.Yes: e.Cancel = false; this.notifyIcon1.Dispose(); break; default: e.Cancel = true; break; } } catch { e.Cancel = true; }
dgv.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;居中
原文:http://www.cnblogs.com/wangchuang/p/5123973.html