Fabasia
Messages postés45Date d'inscriptionmercredi 26 mars 2008StatutMembreDernière intervention17 août 2012
-
23 mars 2011 à 11:58
Fabasia
Messages postés45Date d'inscriptionmercredi 26 mars 2008StatutMembreDernière intervention17 août 2012
-
23 mars 2011 à 12:36
Mon code génère une erreur que je ne peux comprendre ...
Dans la Form2, je fais un form4.dispose, ce qui lance la sub new de form4 et genere une erreur 'System.Windows.Forms.AxHost+InvalidActiveXStateException' du fait de Dim AcroPDF_document As New AxAcroPDFLib.AxAcroPDF
Si je crée moi même le controle AcroPDF_document dans la form pas de pb, si le programme le crée dans la sub new --> Pb ????
Comment résoudre ca ? Merci
Mon code :
Public Class Form4
Sub New()
' Cet appel est requis par le Concepteur Windows Form.
InitializeComponent()
' Ajoutez une initialisation quelconque après l'appel InitializeComponent().
'La form fait 90% de la taille de l'écran
Size = New Size(CInt(0.9 * My.Computer.Screen.WorkingArea.Width), CInt(0.9 * My.Computer.Screen.WorkingArea.Height))
FormBorderStyle = Windows.Forms.FormBorderStyle.FixedDialog
MaximizeBox = False
MinimizeBox = False
StartPosition = FormStartPosition.CenterScreen
TopMost = True
Dim AxAcroPDF_document As New AxAcroPDFLib.AxAcroPDF
AxAcroPDF_document.Name = "AxAcroPDF_document"
AxAcroPDF_document.src = Nothing
AxAcroPDF_document.Dock = DockStyle.Fill
AxAcroPDF_document.Visible = True
AxAcroPDF_document.setShowToolbar(False)
AxAcroPDF_document.setShowScrollbars(True)
Controls.Add(AxAcroPDF_document)
.......