Actually code:
Form Form2 = new Form1(); Form2.Size = new System.Drawing.Size(1000, 300); Form2.BackColor = System.Drawing.Color.Red; Form2.MaximizeBox = false; Form2.MinimizeBox = false; Form2.FormBorderStyle = FormBorderStyle.FixedDialog; Form2.Text = "CryptLocker Moscow"; Label text_for_user = new Label(); text_for_user.ForeColor = System.Drawing.Color.White; text_for_user.Top = 100; text_for_user.AutoSize = false; text_for_user.Text = "HEY, USER!!!"; text_for_user.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; text_for_user.Size = new System.Drawing.Size(50, 50); text_for_user.Font = new System.Drawing.Font("Arial", text_for_user.Font.Size); text_for_user.Dock = System.Windows.Forms.DockStyle.Fill; Form2.Controls.Add(text_for_user); Application.Run(Form2); So, the line:
text_for_user.Size = new System.Drawing.Size(50, 50); is meaningless, since it is there, it is not there, whether it costs 50.50 or 500.500 there, while executing the program, the text size does not actually change. What to do?
Dockproperty not override the manualSizevalue? - AthariAutoSize? - Athari September