Skip to content

Commit

Permalink
Show connection info dialog added
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKoell committed Jan 23, 2024
1 parent 97b81f1 commit 7914bf3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/RoyalApps.Community.Rdp.WinForms.Demo/RdpForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ public RdpForm()
_rdpControl.SetResizeBehavior(ResizeBehavior.SmartReconnect);
};

var connectionInfo = new ToolStripMenuItem("Show Connection Info");
connectionInfo.Click += (_, _) =>
{
_rdpControl.ShowConnectionInfo();
};

var zoomIn = new ToolStripMenuItem("Zoom In");
zoomIn.Click += (_, _) => _rdpControl.ZoomIn();
var zoomOut = new ToolStripMenuItem("Zoom Out");
Expand All @@ -93,6 +99,8 @@ public RdpForm()
{
connect,
disconnect,
new ToolStripSeparator(),
connectionInfo,
new ToolStripSeparator(),
settings
}
Expand Down
10 changes: 10 additions & 0 deletions src/RoyalApps.Community.Rdp.WinForms/Controls/RdpControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,16 @@ public void SetResizeBehavior(ResizeBehavior resizeBehavior)
return;
RdpClient.SmartSizing = resizeBehavior == ResizeBehavior.SmartSizing;
}

/// <summary>
/// Shows the connection information dialog.
/// </summary>
public void ShowConnectionInfo()
{
if (RdpClient is null)
return;
RdpClient.ShowConnectionInformation = true;
}

/// <summary>
/// Ensure the ActiveX control updates the client size according to the control size.
Expand Down

0 comments on commit 7914bf3

Please sign in to comment.