public void UpdateSize(float scale) { if (IsDisposed) { DPIManager.Unregister(this); return; } SuspendLayout(); int border = DPIManager.Adjust(4, scale); int dborder = border * 2; picture.Location = new Point(border, border); picture.Size = new Size(DPIManager.Adjust(44, scale), DPIManager.Adjust(44, scale)); Height = DPIManager.Adjust(52, scale); Size labelSize = TextRenderer.MeasureText(title.Text, title.Font); title.Size = labelSize; float height = this.Height / 2.0f; float lheight = labelSize.Height / 2.0f; title.Location = new Point(picture.Width + picture.Left + border, (int)(height - lheight)); ResumeLayout(); }
public void UpdateSize(float scale) { if (IsDisposed) { DPIManager.Unregister(this); return; } SuspendLayout(); border = DPIManager.Adjust(4, scale); int dborder = border * 2; picture.Location = new Point(border, border); Height = DPIManager.Adjust(46, scale); picture.Size = new Size(Size.Height - dborder, Height - dborder); Width = picture.Width + dborder + title.Width; float height = this.Height / 2.0f; float lheight = title.Size.Height / 2.0f; title.Location = new Point(picture.Width + picture.Left + border, (int)(height - lheight)); ResumeLayout(); }
public void UpdateSize(float scale) { if (IsDisposed) { DPIManager.Unregister(this); return; } SuspendLayout(); int border = DPIManager.Adjust(4, scale); int dborder = border * 2; picture.Location = new Point(border, border); picture.Size = new Size(DPIManager.Adjust(44, scale), DPIManager.Adjust(44, scale)); Height = DPIManager.Adjust(52, scale); Size labelSize = TextRenderer.MeasureText(TitleText, title.Font); Size plabelSize = TextRenderer.MeasureText(PlayerText, players.Font); float reservedSpaceLabel = this.Width - picture.Width; if (labelSize.Width > reservedSpaceLabel) { // make text smaller int charSize = TextRenderer.MeasureText("g", title.Font).Width; int toRemove = (int)((reservedSpaceLabel - labelSize.Width) / (float)charSize); toRemove = Math.Max(toRemove + 3, 7); title.Text = TitleText.Remove(TitleText.Length - toRemove, toRemove) + "..."; } else { title.Text = TitleText; } players.Text = PlayerText; title.Size = labelSize; players.Size = plabelSize; float height = this.Height / 2.0f; float lheight = labelSize.Height / 2.0f; title.Location = new Point(picture.Width + picture.Left + border, (int)(height - labelSize.Height) /*(int)(height - lheight)*/); players.Location = new Point(picture.Width + picture.Left + border + playerIcon.Width + 10, (int)height); playerIcon.Location = new Point(picture.Width + picture.Left + border + 10, (int)height); playerIcon.Size = new Size(DPIManager.Adjust(players.Size.Height, scale), DPIManager.Adjust(players.Size.Height, scale)); ResumeLayout(); }
public void UpdateSize(float scale) { if (IsDisposed) { DPIManager.Unregister(this); return; } SuspendLayout(); int border = DPIManager.Adjust(8, scale); int dborder = border * 2; checkbox.Location = new Point(12, 11); checkbox.Size = new Size(30, 30); Height = DPIManager.Adjust(52, scale); Size labelSize = TextRenderer.MeasureText(TitleText, title.Font); float reservedSpaceLabel = this.Width - checkbox.Width; if (labelSize.Width > reservedSpaceLabel) { // make text smaller int charSize = TextRenderer.MeasureText("g", title.Font).Width; int toRemove = (int)((reservedSpaceLabel - labelSize.Width) / (float)charSize); toRemove = Math.Max(toRemove + 3, 7); title.Text = TitleText.Remove(TitleText.Length - toRemove, toRemove) + "..."; } else { title.Text = TitleText; } title.Size = labelSize; float height = this.Height / 2.0f; float lheight = labelSize.Height / 2.0f; title.Location = new Point(checkbox.Width + checkbox.Left + border, (int)(height - lheight)); ResumeLayout(); }
public void UpdateSize(float scale) { if (IsDisposed) { DPIManager.Unregister(this); return; } //SuspendLayout(); //Font = DPIManager.Font; //Size defaultSize = DefaultSize; //int wid = DPIManager.Adjust(defaultSize.Width, scale); //int hei = DPIManager.Adjust(defaultSize.Height, scale); ////Size = new Size(wid, hei); //Console.WriteLine("Changed to {0}x{1}", wid, hei); //ResumeLayout(); }
public void UpdateSize(float scale) { if (IsDisposed) { DPIManager.Unregister(this); return; } SuspendLayout(); Font = DPIManager.Font; //AutoScaleMode = AutoScaleMode.Font; //AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); //Size defaultSize = DefaultSize; //int wid = DPIManager.Adjust(defaultSize.Width, scale); //int hei = DPIManager.Adjust(defaultSize.Height, scale); ////Size = new Size(wid, hei); //Console.WriteLine("Changed to {0}x{1}", wid, hei); ResumeLayout(); }