private void LoadLayout() { if (layoutType != null) { layoutType.Clean(); (layoutType as UserControl).Dispose(); } foreach (ToolStripMenuItem item in layoutToolStripMenuItem.DropDownItems) { if (item.Checked) { if (item == dataGridToolStripMenuItem) { layoutType = new GridLayout(entryManager); } if (item == directoryTreeToolStripMenuItem) { layoutType = new TreeLayout(entryManager); } break; } } UserControl layoutControl = layoutType as UserControl; LanguageManager.INSTANCE.AddLocalizableControls(layoutControl); layoutControl.Location = new Point(0, 24); layoutControl.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; layoutControl.Size = new Size(Width - 16, Height - 80); StatusVisibility(false); Controls.Add(layoutControl); }