LoginForm.Designer.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System.Drawing;
  2. using System.Windows.Forms;
  3. namespace TradeApp.WinForms.V08;
  4. partial class LoginForm
  5. {
  6. private System.ComponentModel.IContainer components = null;
  7. private TableLayoutPanel rootLayout;
  8. private Label titleLabel;
  9. private Label loginLabel;
  10. private Label passwordLabel;
  11. private TextBox loginTextBox;
  12. private TextBox passwordTextBox;
  13. private FlowLayoutPanel buttonsPanel;
  14. private Button loginButton;
  15. private Button guestButton;
  16. protected override void Dispose(bool disposing)
  17. {
  18. if (disposing && (components is not null))
  19. {
  20. components.Dispose();
  21. }
  22. base.Dispose(disposing);
  23. }
  24. private void InitializeComponent()
  25. {
  26. rootLayout = new TableLayoutPanel();
  27. titleLabel = new Label();
  28. loginLabel = new Label();
  29. passwordLabel = new Label();
  30. loginTextBox = new TextBox();
  31. passwordTextBox = new TextBox();
  32. buttonsPanel = new FlowLayoutPanel();
  33. loginButton = new Button();
  34. guestButton = new Button();
  35. rootLayout.SuspendLayout();
  36. buttonsPanel.SuspendLayout();
  37. SuspendLayout();
  38. rootLayout.ColumnCount = 2;
  39. rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120F));
  40. rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
  41. rootLayout.Controls.Add(titleLabel, 0, 0);
  42. rootLayout.Controls.Add(loginLabel, 0, 1);
  43. rootLayout.Controls.Add(loginTextBox, 1, 1);
  44. rootLayout.Controls.Add(passwordLabel, 0, 2);
  45. rootLayout.Controls.Add(passwordTextBox, 1, 2);
  46. rootLayout.Controls.Add(buttonsPanel, 1, 3);
  47. rootLayout.Dock = DockStyle.Fill;
  48. rootLayout.Padding = new Padding(20);
  49. rootLayout.RowCount = 4;
  50. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 58F));
  51. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  52. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  53. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 94F));
  54. titleLabel.AutoSize = true;
  55. rootLayout.SetColumnSpan(titleLabel, 2);
  56. titleLabel.Dock = DockStyle.Fill;
  57. titleLabel.Font = new Font("Segoe UI", 16F, FontStyle.Bold);
  58. titleLabel.Text = "Авторизация";
  59. titleLabel.TextAlign = ContentAlignment.MiddleLeft;
  60. loginLabel.Dock = DockStyle.Fill;
  61. loginLabel.Text = "Логин";
  62. loginLabel.TextAlign = ContentAlignment.MiddleLeft;
  63. passwordLabel.Dock = DockStyle.Fill;
  64. passwordLabel.Text = "Пароль";
  65. passwordLabel.TextAlign = ContentAlignment.MiddleLeft;
  66. loginTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Right;
  67. passwordTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Right;
  68. passwordTextBox.UseSystemPasswordChar = true;
  69. buttonsPanel.Controls.Add(loginButton);
  70. buttonsPanel.Controls.Add(guestButton);
  71. buttonsPanel.Dock = DockStyle.Fill;
  72. buttonsPanel.FlowDirection = FlowDirection.RightToLeft;
  73. loginButton.Size = new Size(112, 32);
  74. loginButton.Text = "Войти";
  75. loginButton.UseVisualStyleBackColor = true;
  76. loginButton.Click += LoginButton_Click;
  77. guestButton.Size = new Size(112, 32);
  78. guestButton.Text = "Гость";
  79. guestButton.UseVisualStyleBackColor = true;
  80. guestButton.Click += GuestButton_Click;
  81. AcceptButton = loginButton;
  82. AutoScaleDimensions = new SizeF(8F, 20F);
  83. AutoScaleMode = AutoScaleMode.Font;
  84. ClientSize = new Size(420, 226);
  85. Controls.Add(rootLayout);
  86. FormBorderStyle = FormBorderStyle.FixedDialog;
  87. MaximizeBox = false;
  88. MinimizeBox = false;
  89. StartPosition = FormStartPosition.CenterScreen;
  90. Text = AppearanceSettings.LoginTitle;
  91. BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  92. rootLayout.BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  93. loginButton.BackColor = ColorTranslator.FromHtml(AppearanceSettings.AccentColor);
  94. loginButton.UseVisualStyleBackColor = false;
  95. guestButton.BackColor = ColorTranslator.FromHtml(AppearanceSettings.SecondaryBackgroundColor);
  96. guestButton.UseVisualStyleBackColor = false;
  97. rootLayout.ResumeLayout(false);
  98. rootLayout.PerformLayout();
  99. buttonsPanel.ResumeLayout(false);
  100. ResumeLayout(false);
  101. }
  102. }