troubleshooting Question

Passing Variable from one form to another and opening pdf file

Avatar of Fordraiders
FordraidersFlag for United States of America asked on
Visual Basic.NET
3 Comments1 Solution176 ViewsLast Modified: 2003

2 forms

"form1" =  with tab control(using Tab4)
"cboAdobeFiles" - combobox   this contains a list of pdf  files...
I have code loading the pdf file names ok

Command Button =   "cmdOpAdobe"

code for command button

Public f3 As FormAdobe
Public Sub ShowForm3()
        If f3 Is Nothing Then
            f3 = New FormAdobe
            AddHandler f3.Closed, AddressOf f3_Closed
        End If
    End Sub

When I press this button I'am opening a form called "formAdobe"

I have an ActiveXcontrol for Adobe on this form.
"formAdobe"  =  -- has an activexcontrol called  "AxPdf1"

Pdfs are stored in dir "C:\PdfPages"

What I need:
After I select an Item in the listbox on Form1

I press the command button and it opens "formAdobe"

A NEED A variable passing the listbox selection so the
source for the "AxPdf1" is set to the path specified with the listbox(variable).

In the load event of  "formAdobe"  I'am trying to set the source of the activeXcontrol from the value in the comboxbox on form1

Private Sub FormAdobe_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Me.AxPdf1.LoadFile("C:\PROGRAM FILES\PDFPAGES\00010.PDF")
        ' Me.AxPdf1.LoadFile()
    End Sub

My problem is passing the variable from form1   to FormAdobe ?


Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros