diff --git a/XenAdmin/ConsoleView/VNCTabView.cs b/XenAdmin/ConsoleView/VNCTabView.cs index 4ac907683..aab4f81fd 100644 --- a/XenAdmin/ConsoleView/VNCTabView.cs +++ b/XenAdmin/ConsoleView/VNCTabView.cs @@ -43,6 +43,7 @@ using XenAdmin.Commands; using XenAdmin.Dialogs; using System.Collections.Generic; using System.Diagnostics; +using XenAdmin.Controls.ConsoleTab; namespace XenAdmin.ConsoleView @@ -66,7 +67,7 @@ namespace XenAdmin.ConsoleView private readonly Host targetHost; private VM_guest_metrics guestMetrics = null; private Form fullscreenForm = null; - private Form fullscreenHint = null; + private FullScreenHint fullscreenHint; private Size LastDesktopSize; private bool switchOnTabOpened = false; @@ -1048,8 +1049,7 @@ namespace XenAdmin.ConsoleView fullscreenForm.Location = screen.WorkingArea.Location; fullscreenForm.Size = screen.Bounds.Size; - fullscreenHint = new Controls.ConsoleTab.FullScreenHint(GetFullScreenMessage()); - + fullscreenHint = new FullScreenHint(); fullscreenHint.Show(fullscreenForm); fullscreenForm.Show(); @@ -1081,20 +1081,6 @@ namespace XenAdmin.ConsoleView fullscreenForm.Refresh(); } - string GetFullScreenMessage() - { - switch (Properties.Settings.Default.FullScreenShortcutKey) - { - case 0: - return Messages.VNC_FULLSCREEN_MESSAGE_CTRL_ALT; - case 1: - return Messages.VNC_FULLSCREEN_MESSAGE_CTRL_ALT_F; - case 2: - return Messages.VNC_FULLSCREEN_MESSAGE_F12; - default: - return Messages.VNC_FULLSCREEN_MESSAGE_CTRL_ENTER; - } - } void Connection_BeforeConnectionEnd(object sender, EventArgs e) { Program.Invoke(this, toggleFullscreen); diff --git a/XenAdmin/Controls/ConsoleTab/FullScreenHint.cs b/XenAdmin/Controls/ConsoleTab/FullScreenHint.cs index a72fcb081..a237a75dd 100644 --- a/XenAdmin/Controls/ConsoleTab/FullScreenHint.cs +++ b/XenAdmin/Controls/ConsoleTab/FullScreenHint.cs @@ -48,11 +48,26 @@ namespace XenAdmin.Controls.ConsoleTab int nHeightEllipse // width of ellipse ); - public FullScreenHint(string message) + public FullScreenHint() { InitializeComponent(); Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20)); - label1.Text = message; + label1.Text = GetFullScreenMessage(); + } + + private string GetFullScreenMessage() + { + switch (Properties.Settings.Default.FullScreenShortcutKey) + { + case 0: + return Messages.VNC_FULLSCREEN_MESSAGE_CTRL_ALT; + case 1: + return Messages.VNC_FULLSCREEN_MESSAGE_CTRL_ALT_F; + case 2: + return Messages.VNC_FULLSCREEN_MESSAGE_F12; + default: + return Messages.VNC_FULLSCREEN_MESSAGE_CTRL_ENTER; + } } private void FullScreenHint_Load(object sender, EventArgs e)