C
Christian Schwarz
Hello,
I get a NotSupportedException when using the following code snippet in the
constructor of my ImageButton control:
System.Drawing.Graphics gfx = this.CreateGraphics();
SizeF textSizeF = gfx.MeasureString(this.Text, this.Font);
this.m_TextSize = new Size((int)Math.Floor(textSizeF.Width),
(int)Math.Floor(textSizeF.Height));
gfx.Dispose();
To be exact, the exception is thrown by the first line. Could anyone explain
why CreateGraphics() doesn't work here ?
Christian
I get a NotSupportedException when using the following code snippet in the
constructor of my ImageButton control:
System.Drawing.Graphics gfx = this.CreateGraphics();
SizeF textSizeF = gfx.MeasureString(this.Text, this.Font);
this.m_TextSize = new Size((int)Math.Floor(textSizeF.Width),
(int)Math.Floor(textSizeF.Height));
gfx.Dispose();
To be exact, the exception is thrown by the first line. Could anyone explain
why CreateGraphics() doesn't work here ?
Christian