Changeset 5
- Timestamp:
- Mar 7, 2019, 3:50:35 PM (6 years ago)
- Location:
- Common
- Files:
-
- 1 added
- 2 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 } -
Common/SuspendDrawing.cs
r1 r5 16 16 public static void Suspend(Control parent) 17 17 { 18 SendMessage(parent.Handle, WM_SETREDRAW, false, 0);18 if (parent.Visible) SendMessage(parent.Handle, WM_SETREDRAW, false, 0); 19 19 } 20 20 21 21 public static void Resume(Control parent) 22 22 { 23 SendMessage(parent.Handle, WM_SETREDRAW, true, 0);23 if (parent.Visible) SendMessage(parent.Handle, WM_SETREDRAW, true, 0); 24 24 parent.Refresh(); 25 25 }
Note:
See TracChangeset
for help on using the changeset viewer.