Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Show a PDF file in a MDI application of C#

Show a PDF file in a MDI application of C#

Scheduled Pinned Locked Moved C#
helpcsharplinuxquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BinName
    wrote on last edited by
    #1

    Hello everybody, I encounter a problem and need your help. In a MDI application of C#, I want to show a PDF file in a child form. I have added a PDF browser to the child form and change it to pulic, just like below: public AxAcroPDFLib.AxAcroPDF pdfBrowser; When the MDI load, my code likes below: Code: private void MDIFrm_Load(object sender, EventArgs e) { ChildFrm myChildFrm = new ChildFrm(); myChildFrm.pdfBrowser.LoadFile("C:\\dev\\linux-i18n-intro.pdf"); myChildFrm.MdiParent = this; myChildFrm.Show(); } However,I can not see the PDF content in the Child form,but if I set the ChildFrm as the strartup object,it will show PDF correctly. Could anyone give some suggestions? Thanks very much! Birch

    C 1 Reply Last reply
    0
    • B BinName

      Hello everybody, I encounter a problem and need your help. In a MDI application of C#, I want to show a PDF file in a child form. I have added a PDF browser to the child form and change it to pulic, just like below: public AxAcroPDFLib.AxAcroPDF pdfBrowser; When the MDI load, my code likes below: Code: private void MDIFrm_Load(object sender, EventArgs e) { ChildFrm myChildFrm = new ChildFrm(); myChildFrm.pdfBrowser.LoadFile("C:\\dev\\linux-i18n-intro.pdf"); myChildFrm.MdiParent = this; myChildFrm.Show(); } However,I can not see the PDF content in the Child form,but if I set the ChildFrm as the strartup object,it will show PDF correctly. Could anyone give some suggestions? Thanks very much! Birch

      C Offline
      C Offline
      CKnig
      wrote on last edited by
      #2

      I can only guess: maybe the pdfBrowser loads an empty file on Form_Load? Anyway: you should not put the pdfBrowser on a public property - better give the path to the constructor and set it in the form. Anyway he problem seems to be with the pdfBrowser - maybe try using the webbrowser-control to show your files?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups