Visible Property

D Willett
SilverLounger
Posts: 1728
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Visible Property

Post by D Willett »

Hi
I changed recently from the acrPDF control to the We Browser control.

My previous code worked fine:

Code: Select all

Private Sub PreviewImg_Click()
    PDF1.Visible = True
    Me.txtNote.Visible = False

End Sub
When used the PDF1 (acroPDF) control came to the front of PreviewImg.

My edited code:

Code: Select all

Private Sub PreviewImg_Click()
    WebBrowser1.Visible = True
    Me.txtNote.Visible = False

End Sub
Doesn't act the same. The web browser control doesn't show at the front of previewImg.
Is there a way to bring the web browser control to the front with vb code?

Thanks
Cheers ...

Dave.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Visible Property

Post by Rudi »

Hi,

Are you trying to bring it to the front of other controls or are you wanting the control to display a file (like a pdf document)?
If the latter try integrate the following into your code...
Change Userform1 to Me or the name of your userform.
modify the path to the document to show.

Code: Select all

UserForm1.WebBrowser1.Navigate2 ("C:\Test\Sample.pdf")
UserForm1.Show
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

D Willett
SilverLounger
Posts: 1728
Joined: 25 Jan 2010, 08:34
Location: Stoke on Trent - Staffordshire - England

Re: Visible Property

Post by D Willett »

So it regains focus.............:

Code: Select all

Private Sub PreviewImg_Click()
    WebBrowser1.Visible = True
    WebBrowser1.Navigate2 Me.AcrobatPath.Text
    Me.txtNote.Visible = False

End Sub
This now works......... so easy :-)

Thanks Rudi
Cheers ...

Dave.