Changeset 5 for Common/FormDimensions.cs
- Timestamp:
- Mar 7, 2019, 3:50:35 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/FormDimensions.cs
r1 r5 13 13 class FormDimensions 14 14 { 15 p rivateForm form;15 public Form form; 16 16 public string RegSubKey; 17 17 public FormWindowState defaultFormWindowState = FormWindowState.Normal; … … 200 200 (control as ListView).Columns[I].Width = (int) regKey.GetValue("ColWidth" + I.ToString()); 201 201 } 202 } else 203 if (control is DataGridView) 204 { 205 RegistryKey regKey = Application.UserAppDataRegistry.OpenSubKey(RegSubKey + "\\" + form.Name + "\\" + control.Name, true); 206 if (regKey == null) regKey = Application.UserAppDataRegistry.CreateSubKey(RegSubKey + "\\" + form.Name + "\\" + control.Name); 207 208 for (int I = 0; I < (control as DataGridView).Columns.Count; I++) 209 { 210 if (regKey.GetValue("ColWidth" + I.ToString()) != null) 211 (control as DataGridView).Columns[I].Width = (int)regKey.GetValue("ColWidth" + I.ToString()); 212 } 202 213 } 203 214 … … 218 229 { 219 230 regKey.SetValue("ColWidth" + I.ToString(), (control as ListView).Columns[I].Width); 231 } 232 } else 233 if (control is DataGridView) 234 { 235 RegistryKey regKey = Application.UserAppDataRegistry.OpenSubKey(RegSubKey + "\\" + form.Name + "\\" + control.Name, true); 236 if (regKey == null) regKey = Application.UserAppDataRegistry.CreateSubKey(RegSubKey + "\\" + form.Name + "\\" + control.Name); 237 238 for (int I = 0; I < (control as DataGridView).Columns.Count; I++) 239 { 240 regKey.SetValue("ColWidth" + I.ToString(), (control as DataGridView).Columns[I].Width); 220 241 } 221 242 }
Note:
See TracChangeset
for help on using the changeset viewer.