private TabPage CreateExperiencePage() { TabPage tabPage = NewTabPage("体验"); int rowIndex = 0; int tabIndex = 0; _bandwidthComboBox = FormTools.AddLabeledValueDropDown(tabPage, "&S连接速度", ref rowIndex, ref tabIndex, (BandwidthItem v) => v.Text, _bandwidthItems); _bandwidthComboBox.SelectedIndexChanged += BandwidthCombo_ControlChanged; Label label = FormTools.NewLabel("允许以下:", 0, rowIndex); _desktopBackgroundCheckBox = FormTools.NewCheckBox("桌面背景", 1, rowIndex++, tabIndex++); _desktopBackgroundCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged; _fontSmoothingCheckBox = FormTools.NewCheckBox("字体平滑", 1, rowIndex++, tabIndex++); _fontSmoothingCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged; _desktopCompositionCheckBox = FormTools.NewCheckBox("桌面布置", 1, rowIndex++, tabIndex++); _desktopCompositionCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged; _windowDragCheckBox = FormTools.NewCheckBox("拖动时显示窗口内容", 1, rowIndex++, tabIndex++); _windowDragCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged; _menuAnimationCheckBox = FormTools.NewCheckBox("菜单和窗口动画", 1, rowIndex++, tabIndex++); _menuAnimationCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged; _themesCheckBox = FormTools.NewCheckBox("主题", 1, rowIndex++, tabIndex++); _themesCheckBox.CheckedChanged += PerfCheckBox_CheckedChanged; tabPage.Controls.Add(label, _desktopBackgroundCheckBox, _fontSmoothingCheckBox, _desktopCompositionCheckBox, _windowDragCheckBox, _menuAnimationCheckBox, _themesCheckBox); return(tabPage); }
private TabPage CreateFullScreenPage() { int rowIndex = 0; int tabIndex = 0; TabPage tabPage = NewTabPage("全屏"); _connectionBarEnabledCheckBox = FormTools.NewCheckBox("显示全屏工具栏", 0, rowIndex++, tabIndex++); _connectionBarEnabledCheckBox.CheckedChanged += ConnectionBarEnabledCheckedChanged; _connectionBarAutoHiddenCheckBox = FormTools.NewCheckBox("自动隐藏工具栏", 0, rowIndex++, tabIndex++); _connectionBarAutoHiddenCheckBox.Location = new Point(_connectionBarEnabledCheckBox.Left + 24, _connectionBarAutoHiddenCheckBox.Top); FormTools.AddCheckBox(tabPage, "全屏窗口始终位于顶部", Program.Preferences.Settings.FullScreenWindowIsTopMost, 0, ref rowIndex, ref tabIndex); if (RdpClient.SupportsMonitorSpanning) { FormTools.AddCheckBox(tabPage, "必要时使用多个显示器", Program.Preferences.Settings.UseMultipleMonitors, 0, ref rowIndex, ref tabIndex); } if (RdpClient.SupportsPanning) { _enablePanningCheckBox = FormTools.NewCheckBox("使用平移代替滚动条", 0, rowIndex++, tabIndex++); _enablePanningCheckBox.Setting = Program.Preferences.Settings.EnablePanning; _enablePanningCheckBox.CheckedChanged += EnablePanningCheckedChanged; Label label = FormTools.NewLabel("平移速度", 0, rowIndex); label.Size = new Size(116, 20); label.Location = new Point(_enablePanningCheckBox.Left + 24, label.Top); _panningAccelerationUpDown = new RdcNumericUpDown(); _panningAccelerationUpDown.Location = FormTools.NewLocation(1, rowIndex++); _panningAccelerationUpDown.Minimum = 1m; _panningAccelerationUpDown.Maximum = 9m; _panningAccelerationUpDown.Size = new Size(40, 20); _panningAccelerationUpDown.TabIndex = tabIndex++; _panningAccelerationUpDown.Setting = Program.Preferences.Settings.PanningAcceleration; tabPage.Controls.Add(_enablePanningCheckBox, label, _panningAccelerationUpDown); } tabPage.Controls.Add(_connectionBarEnabledCheckBox, _connectionBarAutoHiddenCheckBox); return(tabPage); }
protected void Create(out int rowIndex, out int tabIndex) { tabIndex = 0; rowIndex = 0; CreateInheritanceControl(ref rowIndex, ref tabIndex); Label label = FormTools.NewLabel("ËõÂÔͼ±ÈÀý:", 0, rowIndex); label.Size = new Size(140, 20); RdcNumericUpDown rdcNumericUpDown = new RdcNumericUpDown(); rdcNumericUpDown.Location = FormTools.NewLocation(1, rowIndex++); rdcNumericUpDown.Location = new Point(rdcNumericUpDown.Location.X, rdcNumericUpDown.Location.Y + 2); rdcNumericUpDown.Minimum = 1m; rdcNumericUpDown.Maximum = 9m; TSettingsGroup settings = base.Settings; rdcNumericUpDown.Setting = settings.ThumbnailScale; rdcNumericUpDown.Size = new Size(40, 20); rdcNumericUpDown.TabIndex = tabIndex++; RdcCheckBox rdcCheckBox = FormTools.NewCheckBox("Ëõ·ÅÍ£¿¿µÄÔ¶³Ì×ÀÃæÒÔÊʺϴ°¿Ú", 0, rowIndex++, tabIndex++); TSettingsGroup settings2 = base.Settings; rdcCheckBox.Setting = settings2.SmartSizeDockedWindow; RdcCheckBox rdcCheckBox2 = FormTools.NewCheckBox("Ëõ·Åδͣ¿¿µÄÔ¶³Ì×ÀÃæÒÔÊʺϴ°¿Ú", 0, rowIndex++, tabIndex++); TSettingsGroup settings3 = base.Settings; rdcCheckBox2.Setting = settings3.SmartSizeUndockedWindow; base.Controls.Add(label, rdcNumericUpDown, rdcCheckBox, rdcCheckBox2); }
public ServerPropertiesTabPage(TabbedSettingsDialog dialog, ServerSettings settings) : base(dialog, settings, "Server Settings") { int tabIndex = 0; int rowIndex = 0; _serverNameTextBox = FormTools.AddLabeledTextBox(this, "&Server name:", base.Settings.ServerName, ref rowIndex, ref tabIndex); _serverNameTextBox.Enabled = true; _serverNameTextBox.TextChanged += ServerNameChanged; _serverNameTextBox.Validate = ValidateServerName; _vmConsoleConnectCheckBox = FormTools.NewCheckBox("&VM console connect", 0, rowIndex, tabIndex++, 140); _vmConsoleConnectCheckBox.CheckedChanged += VMConsoleConnectCheckBox_CheckedChanged; _vmIdLabel = new Label { Location = FormTools.NewLocation(1, rowIndex++), Size = new Size(30, 20), Text = "&id:", TextAlign = ContentAlignment.MiddleLeft, Visible = false }; _vmIdTextBox = new RdcTextBox { Location = new Point(_vmIdLabel.Right, _vmIdLabel.Top), Setting = base.Settings.VirtualMachineId, Size = new Size(340 - _vmIdLabel.Width, 20), TabIndex = tabIndex++, Visible = false }; _displayNameTextBox = FormTools.AddLabeledTextBox(this, "&Display name:", base.Settings.DisplayName, ref rowIndex, ref tabIndex); _displayNameTextBox.Enabled = true; _displayNameTextBox.TextChanged += DisplayNameChanged; _displayNameTextBox.Validate = ValidateDisplayName; _displayNameUserCreated = !base.Settings.ServerName.Value.Equals(base.Settings.DisplayName.Value); AddParentCombo(ref rowIndex, ref tabIndex); AddComment(ref rowIndex, ref tabIndex).Setting = base.Settings.Comment; base.Controls.Add(_vmConsoleConnectCheckBox, _vmIdLabel, _vmIdTextBox); base.FocusControl = _serverNameTextBox; }
public void Create(Control parent, ref int rowIndex, ref int tabIndex) { _disabledLabel = new Label { Enabled = true, Location = new Point(0, (parent.Height - 20) / 2), Size = new Size(parent.Width, 20), TextAlign = ContentAlignment.MiddleCenter, Visible = false }; FromParentCheck = FormTools.NewCheckBox("In&herit from parent", 1, rowIndex++, tabIndex++); FromParentCheck.CheckedChanged += CheckChangedHandler; _sourceButton = new Button { Location = FormTools.NewLocation(1, rowIndex++) }; _sourceButton.Size = new Size(340, _sourceButton.Height); _sourceButton.Click += SourceButton_Click; _sourceButton.TextChanged += SourceButton_TextChanged; parent.Controls.Add(_disabledLabel); parent.Controls.Add(FromParentCheck); parent.Controls.Add(_sourceButton); }