diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index 87b1b10dc..23577ba45 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -37,7 +37,7 @@ namespace mRemoteNG.UI.Forms private bool _showFullPathInTitle; private ConnectionInfo _selectedConnection = null; private SystemMenu _systemMenu; - public MiscTools.Fullscreen _fullscreen; + private MiscTools.Fullscreen _fullscreen; @@ -45,6 +45,7 @@ namespace mRemoteNG.UI.Forms { _showFullPathInTitle = Settings.Default.ShowCompleteConsPathInTitle; InitializeComponent(); + _fullscreen = new MiscTools.Fullscreen(this); } static frmMain() @@ -626,8 +627,8 @@ namespace mRemoteNG.UI.Forms private void ConnectionPanelMenuItem_Click(object sender, EventArgs e) { - ((BaseWindow) ((Control)sender).Tag).Show(pnlDock); - ((BaseWindow) ((Control)sender).Tag).Focus(); + ((BaseWindow) ((ToolStripMenuItem)sender).Tag).Show(pnlDock); + ((BaseWindow) ((ToolStripMenuItem)sender).Tag).Focus(); } private void mMenViewConnections_Click(object sender, EventArgs e) @@ -955,9 +956,10 @@ namespace mRemoteNG.UI.Forms { if (e.Button == MouseButtons.Left) { - if (((Control)sender).Tag is ConnectionInfo) + var tag = ((ToolStripMenuItem)sender).Tag as ConnectionInfo; + if (tag != null) { - Runtime.OpenConnection((ConnectionInfo)((Control)sender).Tag); + Runtime.OpenConnection(tag); } } }