private void ManageProfilesControl_EditProfileRaised(object sender) { // Show / hide the controls UIControl.StopWindowUpdating(this.Handle); generalOptions.Visible = false; about.Visible = false; submissionControl.Visible = true; ManageProfilesControl.Visible = false; // Populate the settings control submissionControl.Profile = UserProfiles.GetProfileByName(ManageProfilesControl.SelectedProfile); // Select the item in the treeview TreeNode objSelectedProfile = null; foreach (TreeNode objNode in tvwOptions.Nodes["ndeProfiles"].Nodes) { if (objNode.Text.Equals(ManageProfilesControl.SelectedProfile)) { objSelectedProfile = objNode; } } if (objSelectedProfile != null) { tvwOptions.SelectedNode = objSelectedProfile; } // Cache the loaded profile CacheLoadedProfile(); UIControl.StartWindowUpdating(this.Handle); }
public ctlGeneralOptions() { InitializeComponent(); UIControl.StopWindowUpdating(this.Handle); // Load the initial settings this.chkShowPreviewButtonBox.Checked = GlobalSettings.ShowPreviewButton; this.chkShowCopyButton.Checked = GlobalSettings.ShowCopyButton; this.chkShowHamButton.Checked = GlobalSettings.ShowHamButton; this.chkShowSelectButton.Checked = GlobalSettings.ShowSelectButton; UIControl.StartWindowUpdating(this.Handle); this.Invalidate(true); this.Refresh(); }
private void tvwOptions_AfterSelect(object sender, TreeViewEventArgs e) { //we need to disable screenupdating while processing the configuration. UIControl.StopWindowUpdating(this.Handle); // Cache profile, if one has been selected CacheLoadedProfile(); tvwOptions.Visible = true; TreeNode selNode = e.Node; if (selNode.Parent != null && selNode.Parent.Name == "ndeProfiles") { // This is a profile node. Load the profile // // Show / hide the controls generalOptions.Visible = false; about.Visible = false; submissionControl.Visible = true; ManageProfilesControl.Visible = false; // Populate the settings control submissionControl.Profile = UserProfiles.GetProfileByName(selNode.Text); // Cache profile CacheLoadedProfile(); } else { switch (selNode.Name) { case "ndeGlobal": generalOptions.Visible = true; about.Visible = false; submissionControl.Visible = false; ManageProfilesControl.Visible = false; break; case "ndeAbout": generalOptions.Visible = false; about.Visible = true; submissionControl.Visible = false; ManageProfilesControl.Visible = false; break; case "ndeProfiles": generalOptions.Visible = false; about.Visible = false; submissionControl.Visible = false; ManageProfilesControl.Visible = true; break; default: generalOptions.Visible = false; about.Visible = true; submissionControl.Visible = false; ManageProfilesControl.Visible = false; break; } } UIControl.StartWindowUpdating(this.Handle); this.Invalidate(true); }