From e2aacef60cd1dde7141401febdf7464c4cd87ad8 Mon Sep 17 00:00:00 2001 From: Andreas Weizel Date: Thu, 26 Jun 2014 02:05:02 +0200 Subject: [PATCH] Fix #328: Settings > File Format Associations Dialog Issue --- .../Project/Src/RegisterFiletypesPanel.Designer.cs | 12 +++++++----- .../Project/Src/RegisterFiletypesPanel.cs | 7 +++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.Designer.cs b/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.Designer.cs index 1970bae87d..fc94603d6f 100644 --- a/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.Designer.cs +++ b/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.Designer.cs @@ -38,7 +38,7 @@ namespace ICSharpCode.FiletypeRegisterer } base.Dispose(disposing); } - + /// /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might @@ -53,24 +53,25 @@ namespace ICSharpCode.FiletypeRegisterer // captionLabel // this.captionLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Right))); this.captionLabel.Location = new System.Drawing.Point(3, 0); this.captionLabel.Name = "captionLabel"; this.captionLabel.Size = new System.Drawing.Size(328, 23); this.captionLabel.TabIndex = 0; this.captionLabel.Text = "${res:ICSharpCode.SharpDevelop.Gui.Dialogs.OptionPanels.RegisterFiletypesPanel.Ca" + - "ptionLabel}"; + "ptionLabel}"; // // fileTypesListBox // this.fileTypesListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.fileTypesListBox.IntegralHeight = false; this.fileTypesListBox.Location = new System.Drawing.Point(3, 26); this.fileTypesListBox.Name = "fileTypesListBox"; this.fileTypesListBox.Size = new System.Drawing.Size(328, 299); this.fileTypesListBox.TabIndex = 1; + this.fileTypesListBox.MouseClick += new System.Windows.Forms.MouseEventHandler(this.fileTypesListBox_MouseClick); // // RegisterFiletypesPanel // @@ -79,6 +80,7 @@ namespace ICSharpCode.FiletypeRegisterer this.Name = "RegisterFiletypesPanel"; this.Size = new System.Drawing.Size(334, 328); this.ResumeLayout(false); + } private System.Windows.Forms.CheckedListBox fileTypesListBox; private System.Windows.Forms.Label captionLabel; diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.cs b/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.cs index 2af5952278..0a40e941a1 100644 --- a/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.cs +++ b/src/AddIns/Misc/FiletypeRegisterer/Project/Src/RegisterFiletypesPanel.cs @@ -80,5 +80,12 @@ namespace ICSharpCode.FiletypeRegisterer } return true; } + + void fileTypesListBox_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) + { + if (fileTypesListBox.IndexFromPoint(e.X, e.Y) == ListBox.NoMatches) { + fileTypesListBox.SelectedIndex = -1; + } + } } }