none
Kindly suggest where an error while loading pdf file selected from list box RRS feed

  • Question

  • private void DocList_Load(object sender, EventArgs e)
            {
                PopulateListBox(listBox1, @"C:\Scan", "*.PDF");
            }

            private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
            {
                IndexingForm indfrm = new IndexingForm(listBox1.SelectedItem.ToString());
                indfrm.Show();
                                              
            }

    public partial class IndexingForm : Form
        {
            string path;
            public IndexingForm(String path)
            {
                this.path = path;
                Console.WriteLine(path);
                InitializeComponent();
            }

            private void IndexingForm_Load(object sender, EventArgs e)
            {

                axAcroPDF1.src =path;
            }
        }

    • Edited by soomro abid Thursday, February 6, 2020 1:58 PM
    Thursday, February 6, 2020 1:55 PM

Answers

  • donot load pdf file i think it needs complete path drive\folder\file, i assigned only file name 
    • Marked as answer by soomro abid Sunday, February 9, 2020 9:45 AM
    Thursday, February 6, 2020 3:29 PM

All replies

  • Hello,

    What is the error? This is important to know else it's a guessing game as per below.

    If it has to do with file not found then use System.IO.File.Exists to check if the file exists. If there is a problem in MouseDoubleClick, first get the selected item via listBox1.Text rather than listBox1.SelectedItem.ToString() check if the file exists.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, February 6, 2020 2:20 PM
    Moderator
  • donot load pdf file i think it needs complete path drive\folder\file, i assigned only file name 
    • Marked as answer by soomro abid Sunday, February 9, 2020 9:45 AM
    Thursday, February 6, 2020 3:29 PM
  • Hi soomro abid,

    You seem to have found the cause of the error, haven't you?

    If so, you can click "Mark as answer" below your own reply, so that it will help other members to find the solution quickly if they face a similar issue.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 7, 2020 6:46 AM