Windows Develop Bookmark and Share   
 index > Windows Forms General > ArgumentException on Textbox object, please help!
 

ArgumentException on Textbox object, please help!

I'm getting an exception in my windows forms application on this line:

this.textBox1 = new System.Windows.Forms.TextBox();

the exception text:

A first chance exception of type 'System.ArgumentException' occurred in system.drawing.dll
 
Additional information: Only TrueType fonts are supported, and this is not a TrueType font.


This textbox is inside another control, but this call is in the InitializeComponent() method that is generated by vis studio. I'm not getting the error anywhere else that I'm using textboxes. The control it's inside derives from System.Windows.Forms.UserControl.

Help? I have to have this project done before I can leave the company for a higher paying job, and I'm completely out of ideas!
MigrationUser 1  Monday, September 20, 2004 3:19 PM
I am getting the same error.  The error seems to occur to the first button that is added.  To the form.  I am currently using the following dirty workaround:

        Try
            Me.Controls.Add(Me.cmdCalculateAll)
        Catch ex As Exception
            'Do nothing
        End Try

Can anyone help!
MigrationUser 1  Thursday, December 16, 2004 12:18 PM

You can use google to search for other answers

Custom Search

More Threads

• multiple definations with identical signatures
• Using Executable files as resources (maybe)
• Change Font size for MessageBox.Show dialogs?
• Referencing another form
• Textboxes & Text Files
• instantiating form from combobox list of objects
• unable to display complete drawing
• How to stop the form auto refresh?
• Cloning a form
• Simple questions about scrollbar, memory, application deleting after its closed and GetAsyncKeyState Function