System.Drawing exception

K

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
 
H

Herfried K. Wagner [MVP]

Kyjan said:
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.
 
K

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top