3

在我的应用程序中,我正在使用远程桌面 ActiveX 控件

如何最大化 RDP 会话?我希望它在连接后全屏显示。

4

1 回答 1

1

我不确定您是通过网络还是 WinForms 应用程序使用它,但如果它来自 WinForms 应用程序,您可以执行以下操作。

首先你需要订阅 OnConnected 事件

  // Subscribe to the OnConnected Event in the constructor or via the form designer.
  this.axMsRdpClient91.OnConnected += new System.EventHandler(this.axMsRdpClient91_OnConnected);


private void btnFullscreen_Click( object sender, EventArgs e )
{
  if ( axMsRdpClient91.Connected == 0 )
  {

    axMsRdpClient91.UserName = "Username";
    axMsRdpClient91.Server = "address to server to connect to";
    // Connect to the server
    axMsRdpClient91.Connect();
  }

}
// When the the ActiveXControl raises the OnConnected event set the screen to full screen mode.
private void axMsRdpClient91_OnConnected( object sender, EventArgs e )
{
  ( (AxMSTSCLib.AxMsRdpClient9)sender ).FullScreen = true;
}
于 2014-08-29T09:09:45.970 回答