using System.Drawing; using System.Windows.Forms; namespace ToyStoreApp; partial class LoginForm { private System.ComponentModel.IContainer components = null; private TableLayoutPanel rootLayout; private Label titleLabel; private Label loginLabel; private Label passwordLabel; private TextBox loginTextBox; private TextBox passwordTextBox; private FlowLayoutPanel buttonsPanel; private Button loginButton; private Button guestButton; protected override void Dispose(bool disposing) { if (disposing && (components is not null)) { components.Dispose(); } base.Dispose(disposing); } private void InitializeComponent() { rootLayout = new TableLayoutPanel(); titleLabel = new Label(); loginLabel = new Label(); passwordLabel = new Label(); loginTextBox = new TextBox(); passwordTextBox = new TextBox(); buttonsPanel = new FlowLayoutPanel(); loginButton = new Button(); guestButton = new Button(); rootLayout.SuspendLayout(); buttonsPanel.SuspendLayout(); SuspendLayout(); rootLayout.ColumnCount = 2; rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120F)); rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); rootLayout.Controls.Add(titleLabel, 0, 0); rootLayout.Controls.Add(loginLabel, 0, 1); rootLayout.Controls.Add(loginTextBox, 1, 1); rootLayout.Controls.Add(passwordLabel, 0, 2); rootLayout.Controls.Add(passwordTextBox, 1, 2); rootLayout.Controls.Add(buttonsPanel, 1, 3); rootLayout.Dock = DockStyle.Fill; rootLayout.Padding = new Padding(20); rootLayout.RowCount = 4; rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 58F)); rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F)); rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F)); rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 94F)); titleLabel.AutoSize = true; rootLayout.SetColumnSpan(titleLabel, 2); titleLabel.Dock = DockStyle.Fill; titleLabel.Font = new Font("Segoe UI", 16F, FontStyle.Bold); titleLabel.Text = "Авторизация"; titleLabel.TextAlign = ContentAlignment.MiddleLeft; loginLabel.Dock = DockStyle.Fill; loginLabel.Text = "Логин"; loginLabel.TextAlign = ContentAlignment.MiddleLeft; passwordLabel.Dock = DockStyle.Fill; passwordLabel.Text = "Пароль"; passwordLabel.TextAlign = ContentAlignment.MiddleLeft; loginTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Right; passwordTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Right; passwordTextBox.UseSystemPasswordChar = true; buttonsPanel.Controls.Add(loginButton); buttonsPanel.Controls.Add(guestButton); buttonsPanel.Dock = DockStyle.Fill; buttonsPanel.FlowDirection = FlowDirection.RightToLeft; loginButton.Size = new Size(112, 32); loginButton.Text = "Войти"; loginButton.UseVisualStyleBackColor = true; loginButton.Click += LoginButton_Click; guestButton.Size = new Size(112, 32); guestButton.Text = "Гость"; guestButton.UseVisualStyleBackColor = true; guestButton.Click += GuestButton_Click; AcceptButton = loginButton; AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(420, 226); Controls.Add(rootLayout); FormBorderStyle = FormBorderStyle.FixedDialog; MaximizeBox = false; MinimizeBox = false; StartPosition = FormStartPosition.CenterScreen; Text = AppearanceSettings.LoginTitle; BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor); rootLayout.BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor); loginButton.BackColor = ColorTranslator.FromHtml(AppearanceSettings.AccentColor); loginButton.UseVisualStyleBackColor = false; guestButton.BackColor = ColorTranslator.FromHtml(AppearanceSettings.SecondaryBackgroundColor); guestButton.UseVisualStyleBackColor = false; rootLayout.ResumeLayout(false); rootLayout.PerformLayout(); buttonsPanel.ResumeLayout(false); ResumeLayout(false); } }