Exemplo n.º 1
0
        /// <summary>
        /// Update base text box.
        /// </summary>
        private void UpdateBaseTextBox()
        {
            if (this._baseTextBox == null)
            {
                return;
            }

            this._baseTextBox.Font = ModernFonts.TextBox(this._modernFontSize, this._modernFontWeight);

            if (this.DisplayIcon)
            {
                Point textBoxLocation = new Point(this.IconSize.Width + 4, 3);

                if (this.IconRight)
                {
                    textBoxLocation = new Point(3, 3);
                }

                this._baseTextBox.Location = textBoxLocation;
                this._baseTextBox.Size     = new Size(this.Width - 7 - this.IconSize.Width, this.Height - 6);
            }
            else
            {
                this._baseTextBox.Location = new Point(3, 3);
                this._baseTextBox.Size     = new Size(this.Width - 6, this.Height - 6);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create base text box.
        /// </summary>
        private void CreateBaseTextBox()
        {
            if (this._baseTextBox != null)
            {
                return;
            }

            this._baseTextBox = new PromptedTextBox();

            this._baseTextBox.BorderStyle = BorderStyle.None;
            this._baseTextBox.Font        = ModernFonts.TextBox(this._modernFontSize, this._modernFontWeight);
            this._baseTextBox.Location    = new Point(3, 3);
            this._baseTextBox.Size        = new Size(this.Width - 6, this.Height - 6);

            this.Size = new Size(this._baseTextBox.Width + 6, this._baseTextBox.Height + 6);

            this._baseTextBox.TabStop = true;

            Controls.Add(this._baseTextBox);
        }