private void SetResolution() { try { if (this.Force == Connection.Info.Force.Fullscreen) { RDP_Client.FullScreen = true; RDP_Client.DesktopWidth = Screen.FromControl(frmMain.defaultInstance).Bounds.Width; RDP_Client.DesktopHeight = Screen.FromControl(frmMain.defaultInstance).Bounds.Height; return; } if (this.InterfaceControl.Info.Resolution == RDPResolutions.FitToWindow) { RDP_Client.DesktopWidth = this.InterfaceControl.Size.Width; RDP_Client.DesktopHeight = this.InterfaceControl.Size.Height; } else if (this.InterfaceControl.Info.Resolution == RDPResolutions.SmartSize) { //ToDo //RDP_Client.AdvancedSettings.SmartSizing = true; RDP_Client.DesktopWidth = this.InterfaceControl.Size.Width; RDP_Client.DesktopHeight = this.InterfaceControl.Size.Height; } else if (this.InterfaceControl.Info.Resolution == RDPResolutions.Fullscreen) { RDP_Client.FullScreen = true; RDP_Client.DesktopWidth = Screen.FromControl(frmMain.defaultInstance).Bounds.Width; RDP_Client.DesktopHeight = Screen.FromControl(frmMain.defaultInstance).Bounds.Height; } else { RDP_Client.DesktopWidth = Resolutions.Items(Conversion.Int(this.Info.Resolution)).Width; RDP_Client.DesktopHeight = Resolutions.Items(Conversion.Int(this.Info.Resolution)).Height; } } catch (Exception ex) { Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strRdpSetResolutionFailed + Constants.vbNewLine + ex.Message, true); } }