Home All Groups Group Topic Archive Search About

System.Drawing exception

Author
9 Mar 2006 2:30 PM
Kyjan
Greetings to all!

I was wondering if anyone had ever seen this error before:

Exception message: Invalid parameter used. (source='System.Drawing',
method='GetHeight')

Portion of the stack trace: System.Drawing.Font.GetHeight(Graphics
graphics)
   at System.Drawing.Font.GetHeight()
   at System.Drawing.Font.get_Height()
   at System.Windows.Forms.Control.get_FontHeight()
   at System.Windows.Forms.TextBoxBase.get_PreferredHeight()
   at System.Windows.Forms.TextBoxBase.AdjustHeight()
   at System.Windows.Forms.TextBoxBase.OnHandleCreated(EventArgs e)

If anyone has seen this before, I would deeply appreciate some guidance
on how to stop it.  Nothing is being done that is special - this error
just occurs when my program loads.

Thanks,

Kyjan

Author
9 Mar 2006 2:36 PM
Herfried K. Wagner [MVP]
Show quote Hide quote
"Kyjan" <HolySaphAn***@gmail.com> schrieb:
> I was wondering if anyone had ever seen this error before:
>
> Exception message: Invalid parameter used. (source='System.Drawing',
> method='GetHeight')
>
> Portion of the stack trace: System.Drawing.Font.GetHeight(Graphics
> graphics)
>   at System.Drawing.Font.GetHeight()
>   at System.Drawing.Font.get_Height()
>   at System.Windows.Forms.Control.get_FontHeight()
>   at System.Windows.Forms.TextBoxBase.get_PreferredHeight()
>   at System.Windows.Forms.TextBoxBase.AdjustHeight()
>   at System.Windows.Forms.TextBoxBase.OnHandleCreated(EventArgs e)
>
> If anyone has seen this before, I would deeply appreciate some guidance
> on how to stop it.  Nothing is being done that is special - this error
> just occurs when my program loads.

Which font do you use for your form and/or textbox?  Check out if changing
the font solves the problem.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
9 Mar 2006 2:41 PM
Kyjan
I'm using Verdana as the font.  I am using an inherited textbox if that
makes any difference (I'm only inheriting it so I can make sure only
numbers go into the textbox).

Kyjan