Small Dialogs - How Small Can I Go ??
-
Below is a configuration for a 31x60 dialog I wanted for a small button column which I could load besides my main form. The Height works, but the Width does not go to 31, and although the Debug version says the Form's Width is 31, it still draws something much wider. Is there some minimum width a form can go to? // // Utilities // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.ClientSize = new System.Drawing.Size(32, 60); this.ControlBox = false; this.Controls.Add(this.btSettings); this.Controls.Add(this.btEvents); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.MaximizeBox = false; this.MaximumSize = new System.Drawing.Size(32, 60); this.MinimizeBox = false; this.Name = "Utilities"; this.ShowIcon = false; this.ShowInTaskbar = false; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Utilities"; this.TopMost = true; this.ResumeLayout(false);
-
Below is a configuration for a 31x60 dialog I wanted for a small button column which I could load besides my main form. The Height works, but the Width does not go to 31, and although the Debug version says the Form's Width is 31, it still draws something much wider. Is there some minimum width a form can go to? // // Utilities // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.ClientSize = new System.Drawing.Size(32, 60); this.ControlBox = false; this.Controls.Add(this.btSettings); this.Controls.Add(this.btEvents); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.MaximizeBox = false; this.MaximumSize = new System.Drawing.Size(32, 60); this.MinimizeBox = false; this.Name = "Utilities"; this.ShowIcon = false; this.ShowInTaskbar = false; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Utilities"; this.TopMost = true; this.ResumeLayout(false);
-
Below is a configuration for a 31x60 dialog I wanted for a small button column which I could load besides my main form. The Height works, but the Width does not go to 31, and although the Debug version says the Form's Width is 31, it still draws something much wider. Is there some minimum width a form can go to? // // Utilities // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.ClientSize = new System.Drawing.Size(32, 60); this.ControlBox = false; this.Controls.Add(this.btSettings); this.Controls.Add(this.btEvents); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.MaximizeBox = false; this.MaximumSize = new System.Drawing.Size(32, 60); this.MinimizeBox = false; this.Name = "Utilities"; this.ShowIcon = false; this.ShowInTaskbar = false; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Utilities"; this.TopMost = true; this.ResumeLayout(false);
All the property setting you already have plus MinimumSize = 1,1 Why you want to do it though is another question? [edit] I forgot to add that the forms Text value needs to be empty.
"You get that on the big jobs."
modified on Monday, February 7, 2011 8:01 AM
-
Below is a configuration for a 31x60 dialog I wanted for a small button column which I could load besides my main form. The Height works, but the Width does not go to 31, and although the Debug version says the Form's Width is 31, it still draws something much wider. Is there some minimum width a form can go to? // // Utilities // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.ClientSize = new System.Drawing.Size(32, 60); this.ControlBox = false; this.Controls.Add(this.btSettings); this.Controls.Add(this.btEvents); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.MaximizeBox = false; this.MaximumSize = new System.Drawing.Size(32, 60); this.MinimizeBox = false; this.Name = "Utilities"; this.ShowIcon = false; this.ShowInTaskbar = false; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Utilities"; this.TopMost = true; this.ResumeLayout(false);
Set the
MinimumSize
property to the same as yourMaximumSize
property.".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997 -
All the property setting you already have plus MinimumSize = 1,1 Why you want to do it though is another question? [edit] I forgot to add that the forms Text value needs to be empty.
"You get that on the big jobs."
modified on Monday, February 7, 2011 8:01 AM