Add context menu

This commit is contained in:
Jaex 2023-04-14 23:20:12 +03:00
parent 6344565630
commit 00bdb927ea
2 changed files with 6 additions and 0 deletions

View file

@ -39,6 +39,7 @@ private void InitializeComponent()
this.rtbText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtbText.Location = new System.Drawing.Point(8, 8);
this.rtbText.Name = "rtbText";
this.rtbText.ReadOnly = true;
this.rtbText.Size = new System.Drawing.Size(968, 745);
this.rtbText.TabIndex = 1;
this.rtbText.Text = "";

View file

@ -35,6 +35,7 @@ public partial class OutputBox : Form
private OutputBox(string text, string title, bool scrollToEnd = false)
{
InitializeComponent();
rtbText.AddContextMenu();
ShareXResources.ApplyTheme(this);
Text = "ShareX - " + title;
@ -60,6 +61,10 @@ private void OutputBox_Shown(object sender, EventArgs e)
{
NativeMethods.SendMessage(rtbText.Handle, (int)WindowsMessages.VSCROLL, (int)ScrollBarCommands.SB_BOTTOM, 0);
}
else
{
NativeMethods.SendMessage(rtbText.Handle, (int)WindowsMessages.VSCROLL, (int)ScrollBarCommands.SB_TOP, 0);
}
}
private void rtbText_KeyUp(object sender, KeyEventArgs e)