Example #1
0
        protected RdcTextBox AddComment(ref int rowIndex, ref int tabIndex)
        {
            Label      label      = FormTools.NewLabel("&Comment:", 0, rowIndex);
            RdcTextBox rdcTextBox = FormTools.NewTextBox(1, rowIndex++, tabIndex++, 7);

            rdcTextBox.Enabled = true;
            base.Controls.Add(label, rdcTextBox);
            return(rdcTextBox);
        }
Example #2
0
        protected RdcTextBox AddComment(ref int rowIndex, ref int tabIndex)
        {
            Label label = FormTools.NewLabel("备注:", 0, rowIndex);            //("&Comment:", 0, rowIndex)

            label.Size = new System.Drawing.Size(label.Size.Width - 100, label.Size.Height);
            RdcTextBox rdcTextBox = FormTools.NewTextBox(1, rowIndex++, tabIndex++, 10);

            rdcTextBox.Enabled  = true;
            rdcTextBox.Location = new System.Drawing.Point(rdcTextBox.Location.X - 100, rdcTextBox.Location.Y);
            rdcTextBox.Size     = new System.Drawing.Size(rdcTextBox.Size.Width + 100, rdcTextBox.Size.Height - 8);
            base.Controls.Add(label, rdcTextBox);
            return(rdcTextBox);
        }
        public ImportServersPropertiesPage(TabbedSettingsDialog dialog)
            : base(dialog, (SettingsGroup)null, "Server Settings")
        {
            int   tabIndex = 0;
            int   num      = 0;
            Label value    = new Label
            {
                Location = FormTools.NewLocation(0, num),
                Size     = new Size(480, 48),
                Text     = "选择包含服务器信息的文件,或在下面的文本框中输入信息。 服务器名称由逗号和换行符分隔。 允许扩展。"
            };

            num += 2;
            base.Controls.Add(value);
            Button browseButton = new Button
            {
                TabIndex = tabIndex++,
                Text     = "&B浏览"
            };

            browseButton.Click           += OnBrowseClick;
            _fileNameTextBox              = FormTools.AddLabeledTextBox(this, "&File name:", ref num, ref tabIndex);
            _fileNameTextBox.Enabled      = true;
            _fileNameTextBox.Width       -= browseButton.Width + 8;
            browseButton.Location         = new Point(_fileNameTextBox.Right + 8, _fileNameTextBox.Top);
            _serversTextBox               = FormTools.NewTextBox(1, num, tabIndex++, 7);
            _serversTextBox.AcceptsReturn = true;
            _serversTextBox.Enabled       = true;
            _serversTextBox.ScrollBars    = ScrollBars.Vertical;
            num += 6;
            base.Controls.Add(browseButton, _serversTextBox);
            AddParentCombo(ref num, ref tabIndex);
            RdcTextBox   fileNameTextBox = _fileNameTextBox;
            EventHandler value2          = delegate
            {
                _serversTextBox.Enabled = string.IsNullOrEmpty(_fileNameTextBox.Text);
            };

            fileNameTextBox.TextChanged += value2;
            _serversTextBox.TextChanged += delegate
            {
                RdcTextBox fileNameTextBox2 = _fileNameTextBox;
                bool       enabled          = browseButton.Enabled = string.IsNullOrEmpty(_serversTextBox.Text);
                fileNameTextBox2.Enabled = enabled;
            };
            base.FocusControl = _fileNameTextBox;
        }
Example #4
0
        public FindServersDialog()
            : base("查找服务", "选择")
        {
            int rowIndex = 0;
            int tabIndex = 0;

            AddLabel("输入以过滤服务器", ref rowIndex, ref tabIndex);
            _filterTextBox              = FormTools.NewTextBox(0, rowIndex++, tabIndex++);
            _filterTextBox.Enabled      = true;
            _filterTextBox.Width        = 500;
            _filterTextBox.TextChanged += Filter_TextChanged;
            base.Controls.Add(_filterTextBox);
            AddListView(ref rowIndex, ref tabIndex);
            base.ListView.ContextMenuStrip          = new ContextMenuStrip();
            base.ListView.ContextMenuStrip.Opening += ContextMenuPopup;
            InitButtons();
            this.ScaleAndLayout();
            _previousFilterText = string.Empty;
            CollectServers();
            PopulateList();
        }