mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-30 20:20:34 +12:00
Use ContextMenuStrip instead of ContextMenu
This commit is contained in:
parent
a149c608b7
commit
1b00fb0538
|
@ -297,7 +297,7 @@ internal class Resources {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to More info.
|
||||
/// Looks up a localized string similar to More info....
|
||||
/// </summary>
|
||||
internal static string HistoryItemManager_InitializeComponent_More_info {
|
||||
get {
|
||||
|
|
|
@ -182,7 +182,7 @@
|
|||
<value>Open</value>
|
||||
</data>
|
||||
<data name="HistoryItemManager_InitializeComponent_More_info" xml:space="preserve">
|
||||
<value>More info</value>
|
||||
<value>More info...</value>
|
||||
</data>
|
||||
<data name="HistoryItemManager_InitializeComponent_HTML_link" xml:space="preserve">
|
||||
<value>HTML link</value>
|
||||
|
|
|
@ -55,10 +55,11 @@ public ObjectListView()
|
|||
MultiSelect = false;
|
||||
Columns.Add(Resources.ObjectListView_ObjectListView_Name, 125);
|
||||
Columns.Add(Resources.ObjectListView_ObjectListView_Value, 300);
|
||||
ContextMenu contextMenu = new ContextMenu();
|
||||
contextMenu.MenuItems.Add(Resources.ObjectListView_ObjectListView_Copy_name).Click += PropertyListView_Click_Name;
|
||||
contextMenu.MenuItems.Add(Resources.ObjectListView_ObjectListView_Copy_value).Click += PropertyListView_Click_Value;
|
||||
ContextMenu = contextMenu;
|
||||
ContextMenuStrip cms = new ContextMenuStrip();
|
||||
cms.ShowImageMargin = false;
|
||||
cms.Items.Add(Resources.ObjectListView_ObjectListView_Copy_name).Click += PropertyListView_Click_Name;
|
||||
cms.Items.Add(Resources.ObjectListView_ObjectListView_Copy_value).Click += PropertyListView_Click_Value;
|
||||
ContextMenuStrip = cms;
|
||||
}
|
||||
|
||||
private void PropertyListView_Click_Name(object sender, EventArgs e)
|
||||
|
@ -66,6 +67,7 @@ private void PropertyListView_Click_Name(object sender, EventArgs e)
|
|||
if (SelectedItems.Count > 0)
|
||||
{
|
||||
string text = SelectedItems[0].Text;
|
||||
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
ClipboardHelpers.CopyText(text);
|
||||
|
@ -78,6 +80,7 @@ private void PropertyListView_Click_Value(object sender, EventArgs e)
|
|||
if (SelectedItems.Count > 0)
|
||||
{
|
||||
string text = SelectedItems[0].SubItems[1].Text;
|
||||
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
ClipboardHelpers.CopyText(text);
|
||||
|
|
Loading…
Reference in a new issue