-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContextMenuUtilities.cs
32 lines (30 loc) · 1.01 KB
/
ContextMenuUtilities.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Drawing;
using System.Windows.Forms;
namespace MaliceRAT
{
public static class ContextMenuUtilities
{
public static ToolStripMenuItem CreateContextMenuItem(string text, EventHandler onClick)
{
ToolStripMenuItem menuItem = new ToolStripMenuItem(text);
menuItem.BackColor = Color.FromArgb(23, 23, 24);
menuItem.ForeColor = Color.FromArgb(255, 255, 255);
menuItem.TextAlign = ContentAlignment.MiddleLeft;
menuItem.Click += onClick;
return menuItem;
}
public static void GunaTable_MouseDown(object sender, MouseEventArgs e, DataGridView gunaTable)
{
if (e.Button == MouseButtons.Right)
{
var hti = gunaTable.HitTest(e.X, e.Y);
gunaTable.ClearSelection();
if (hti.RowIndex != -1)
{
gunaTable.Rows[hti.RowIndex].Selected = true;
}
}
}
}
}