Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adobe reader control delays load
Message
De
12/08/2010 18:34:25
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Adobe reader control delays load
Divers
Thread ID:
01476404
Message ID:
01476404
Vues:
190
Hello everybody.

I have a form in VB 2010 Express. this form contains a tabcontrol with 3 pages, each page some buttons. Above that tabcontrol i got a adobe reader control (should be version 9.3.3).

the idea is that when i press a button on page 3 the following happens
- some processing
- load a new page into the adobe reader
- set the focus to a textbox on page 3

Works like a charm, however, it seems that the textbox get the focus briefly, but then the adobe control grabs the focus for itself. Looks like the new documents gets loaded after all of the VB code has executed.

Any clues on this?

Here is the rundown of what i got in the code (I included only the relevant functions)
   Private Sub Btn_Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Save.Click
        Me.SaveDoc()
        If Me.ProcessWhenDone.Checked = False Then
            Me.PrepareTarget(Me.RecPointer)
            Me.MoveDoc(Me.DocList(Me.RecPointer, 0), Me.DocList(Me.RecPointer, 1), Me.DocList(Me.RecPointer, 6))
        End If
        Me.GetNextDoc()
        Me.ControlFocus()
    End Sub

   Private Sub GetNextDoc()
        RecPointer = RecPointer + 1
        Me.DocType.Text = Me.DocList(Me.RecPointer, 2)
        Me.DocDate.Text = Me.DocList(Me.RecPointer, 3)
        Me.Field1.Text = Me.DocList(Me.RecPointer, 0)
        Me.Field3.Text = Me.DocList(Me.RecPointer, 4)
        Me.Field4.Text = Me.DocList(Me.RecPointer, 5)
        Me.AxAcroPDF1.LoadFile(Me.DocList(Me.RecPointer, 0))
       ' Me.AxAcroPDF1.setCurrentHighlight(305, 420, 705, 650)
    End Sub

   Private Sub ControlFocus()
        If Me.Master_DocType_Check.Checked = False Then
            Me.DocType.Focus()
            'Me.ActiveControl("DocType")
        Else
            If Me.Master_DocDate_Check.Checked = False Then
                Me.DocDate.Focus()
            Else
                Me.Field3.Focus()
            End If
        End If
    End Sub
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform