public void Link_Font_Change_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { FontDialog FntDlg = new FontDialog(); FntDlg.ShowDialog(); if (FntDlg.ShowDialog() == DialogResult.OK) { string fontName; fontName = FntDlg.Font.Name; float fontSize; fontSize = FntDlg.Font.Size; } }
if (FntDlg.ShowDialog() == DialogResult.OK) { System.Drawing.Graphics g = this.CreateGraphics(); System.Drawing.SizeF size = g.MeasureString( "your current string value" ,FntDlg.Font ); // do something with the calculated size; // ...and after that remember to release the resources. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)