I am trying to code a program that would synchronize the scrolling of two PDFs between two computers. I have no experience in C# programming but I have fooled around with Visual C++ alot. Anyway, my problem is that whenever I run my still very basic code I get the following error message: "Object reference not set to an instance of an object." with a break or continue option.
Here's my code for now:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DocSync
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
webBrowser1.Navigate("C:\\Users\\Anas\\Desktop\\someDocument.pdf");
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text= webBrowser1.Document.Body.ScrollRectangle.Height.ToString();
}
}
}
Thanks in advance for any response. Also, I would appreciate any suggestions to how to proceed with what I want to achieve.