protected override void OnLoad(object sender, EventArgs e) { lvProfiles.LargeImageList = ilProfileIcons.IconsList; btnEdit.Enabled = false; btnDelete.Enabled = false; UpdateProfiles(); SelectProfile(x => x.IsDefault); var lm = new LayoutManager(this) .Bind(lvProfiles) .WidthToForm() .HeightToForm() .Bind(btnAdd, btnEdit, btnDelete, btnDone) .BottomToForm() .Bind(btnDone, btnScan) .RightToForm() .Bind(btnEdit) .LeftTo(() => btnAdd.Right) .Bind(btnDelete) .LeftTo(() => btnEdit.Right) .Activate(); iconButtonSizer.WidthOffset = 20; iconButtonSizer.PaddingRight = 4; iconButtonSizer.MaxWidth = 100; iconButtonSizer.ResizeButtons(btnAdd, btnEdit, btnDelete); lm.UpdateLayout(); }
protected override void OnLoad(object sender, EventArgs e) { lvProfiles.LargeImageList = ilProfileIcons.IconsList; btnAdd.Enabled = !(appConfigManager.Config.NoUserProfiles && profileManager.Profiles.Any(x => x.IsLocked)); btnEdit.Enabled = false; btnDelete.Enabled = false; UpdateProfiles(); SelectProfile(x => x.IsDefault); if (appConfigManager.Config.NoUserProfiles && profileManager.Profiles.Any(x => x.IsLocked)) { contextMenuStrip.Items.Remove(ctxCopy); contextMenuStrip.Items.Remove(ctxPaste); contextMenuStrip.Items.Remove(toolStripSeparator2); } if (!PlatformCompat.Runtime.IsImagePaddingSupported) { btnScan.ImageAlign = ContentAlignment.MiddleCenter; } var lm = new LayoutManager(this) .Bind(lvProfiles) .WidthToForm() .HeightToForm() .Bind(btnAdd, btnEdit, btnDelete, btnDone) .BottomToForm() .Bind(btnDone, btnScan) .RightToForm() .Bind(btnEdit) .LeftTo(() => btnAdd.Right) .Bind(btnDelete) .LeftTo(() => btnEdit.Right) .Activate(); iconButtonSizer.WidthOffset = 20; iconButtonSizer.PaddingRight = 4; iconButtonSizer.MaxWidth = 100; iconButtonSizer.ResizeButtons(btnAdd, btnEdit, btnDelete); lm.UpdateLayout(); }