public MPoints(int size) { X = new DateTime[size]; for (int i = 0; i < Y.Length; i++) { Y[i] = new PointY(size); } }
private void btnSetting_Click(object sender, EventArgs e) { switch (cmbFormStartState.SelectedIndex) { case 1: { PointX = Convert.ToInt32(Screen.PrimaryScreen.Bounds.Width * 0.1); PointY = Convert.ToInt32(Screen.PrimaryScreen.Bounds.Height * 0.1); SizeWidth = Convert.ToInt32(Screen.PrimaryScreen.Bounds.Width * 0.8); SizeHeight = Convert.ToInt32(Screen.PrimaryScreen.Bounds.Height * 0.8); } break; case 2: { SizeWidth = (int)numWidth.Value; SizeHeight = (int)numHeight.Value; PointX = 0; PointY = 0; } break; } WritePrivateProfileString("Location", "X", PointX.ToString(), Application.StartupPath + @"\configure.ini"); WritePrivateProfileString("Location", "Y", PointY.ToString(), Application.StartupPath + @"\configure.ini"); WritePrivateProfileString("Size", "Width", SizeWidth.ToString(), Application.StartupPath + @"\configure.ini"); WritePrivateProfileString("Size", "Height", SizeHeight.ToString(), Application.StartupPath + @"\configure.ini"); WritePrivateProfileString("Form", "Screen", "None", Application.StartupPath + @"\configure.ini"); WritePrivateProfileString("Form", "BackColor", ColorTranslator.ToHtml(pnlColor.BackColor), Application.StartupPath + @"\configure.ini"); WritePrivateProfileString("Form", "StartState", cmbFormStartState.SelectedIndex.ToString(), Application.StartupPath + @"\configure.ini"); WritePrivateProfileString("Form", "ShowInTaskbar", chkShowInTaskbar.Checked.ToString(), Application.StartupPath + @"\configure.ini"); RegisterFileType(".jpg", "Feep JPG File", Application.StartupPath + @"\Icon\JPG.ico", Application.StartupPath + @"\Feep.exe", cbJPG.Checked); RegisterFileType(".bmp", "Feep BMP File", Application.StartupPath + @"\Icon\BMP.ico", Application.StartupPath + @"\Feep.exe", cbBMP.Checked); RegisterFileType(".png", "Feep PNG File", Application.StartupPath + @"\Icon\PNG.ico", Application.StartupPath + @"\Feep.exe", cbPNG.Checked); RegisterFileType(".gif", "Feep GIF File", Application.StartupPath + @"\Icon\GIF.ico", Application.StartupPath + @"\Feep.exe", cbGIF.Checked); RegisterFileType(".tif", "Feep TIF File", Application.StartupPath + @"\Icon\TIF.ico", Application.StartupPath + @"\Feep.exe", cbTIF.Checked); MessageBox.Show("设置成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); }