PDA

View Full Version : سوال: چگونگی تنظیم کردن ابزار در تمام صفحه



mamad55
یک شنبه 31 شهریور 1392, 16:41 عصر
سلام می خواستم بدونم چطوری میتونم , فرم تمام صفحه پروژه خودمو درست کنم ؟ چون الان فرم که بزرگ میشه عناصر روی فرم ثابت هست مثلا می خوام وقتی فرم بزرگ شد , lable و textbox ها هم یکم بزرگتر بشن هم بیان سمت راست. چطوری میتونم این کارو بکنم ؟

aliagamon
یک شنبه 31 شهریور 1392, 16:51 عصر
anchor :لبخند:

mamad55
یک شنبه 31 شهریور 1392, 17:59 عصر
مثلا می خوام فرم وقتی بزرگ شد , سایز فونت هم بزرگ بشه اینو چی کار کنم ؟

aliagamon
یک شنبه 31 شهریور 1392, 18:37 عصر
خدمت شما ...
http://stackoverflow.com/questions/14328771/how-to-automatically-scale-child-controls-font-sizes-when-form-size-changes

aliagamon
یک شنبه 31 شهریور 1392, 19:11 عصر
البته شما میتونی از یه هم استفاده کنید :

private void Form1_Resize(object sender, EventArgs e)
{
if (this.Size.Height > height || this.Size.Width > width)
{
height = this.Size.Height;
width = this.Size.Width;
foreach(Control cntrl in this.Controls)
cntrl.Font = new Font(cntrl.Font.FontFamily.Name, cntrl.Font.Size + 0.02F);
}
else if (this.Size.Height < height || this.Size.Width < width)
{
height = this.Size.Height;
width = this.Size.Width;
foreach (Control cntrl in this.Controls)
cntrl.Font = new Font(cntrl.Font.FontFamily.Name, cntrl.Font.Size - 0.02F);
}
}