This error is due to the ActiveX Control not being completely initialized when the textBox1_TextChanged event is called as the form loads. This behavior is by design in VS.NET and is largely due to the relative slowness of calling ActiveX controls in the managed code environment.
The workaround is to handle the error using a try|catch statement
and then re-attempt the offending code after the component has been
An example of the try | catch in VB would be:
AxBarCode1.DataToEncode = TextBox1.Text
Catch ex As AxHost.InvalidActiveXStateException
| ©Copyright 2018
IDAutomation.com, All Rights Reserved.
Barcode Fonts | Components | Scanners | Support | Contact Us
Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses.