Is there an option on not to use the open file from the PDF Viewer and instead use a custom button to open the specified file directly?
button 1 open x.pdf file
button 2 open x2.pdf file and so on?
In that way I do not get the prompt box for what doc I want to open.
Thnaks
PDF Viewer
Re: PDF Viewer
Please check out this msdn resouce as well:
http://msdn.microsoft.com/en-us/library ... 10%29.aspx
1) Create a button on the canvas
2) Place the PDFViewer on the canvas
3) Click on the Script Tab
4) Write an event handler for your button(see code below)
void Button1_Click(System.Object sender, System.EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();
if(fd.ShowDialog() == DialogResult.OK) {
PDFViewer1.FileName = fd.FileName;
}
}
http://msdn.microsoft.com/en-us/library ... 10%29.aspx
1) Create a button on the canvas
2) Place the PDFViewer on the canvas
3) Click on the Script Tab
4) Write an event handler for your button(see code below)
void Button1_Click(System.Object sender, System.EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();
if(fd.ShowDialog() == DialogResult.OK) {
PDFViewer1.FileName = fd.FileName;
}
}
Re: PDF Viewer
Thanks for the feedback. But it looks like OpenFileDialog is the same as clicking on the open button from the PDFViewer and selecting a file. The idea is to click on the custom button an automatically open the pdf file using the PDFViewer w/o selecting a file from a list.
Thanks
Thanks
Re: PDF Viewer
I got it. Thanks for your help.
Re: PDF Viewer
Hi,
I need to open a PDF file from a button and I tried the example of stuartm but it didn´t work.
Why did you choose PDFViewer1 ?
I can see in my script PDFViewer without 1 and I put Variadorabb instead of Filename because my file has this name.
void Button26_Click(System.Object sender, System.EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();
if(fd.ShowDialog() == DialogResult.OK)
{
PDFViewer.Variadorabb = fd.Variadorabb;
}
}
Regards.
Antonio
I need to open a PDF file from a button and I tried the example of stuartm but it didn´t work.
Why did you choose PDFViewer1 ?
I can see in my script PDFViewer without 1 and I put Variadorabb instead of Filename because my file has this name.
void Button26_Click(System.Object sender, System.EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();
if(fd.ShowDialog() == DialogResult.OK)
{
PDFViewer.Variadorabb = fd.Variadorabb;
}
}
Regards.
Antonio