How to create windows form to open a pdf file using c#
to open a pdf file in c# we need to use ProcessStartInfo method which inside System.Diagnostic
to make windows form to open a pdf file using c# follow these steps :
Step 1 - open visual studio and goto new project
Step 2 - select c# and windows form application

Step 3 - add a button in the form

Step 4 - open the form code and add using System.Diagnostic; in namespaces

Step 5 - write the code for string variable which holds the values as pdf file path

Step 6 - write the code for ProcessStarInfo method

Step 7 - pass the string variable to start the process
![]() |
output |
this is the output

you can open any pdf using these steps also you can use the open file dialog from the toolbox to select pdf file to open by a user.
Comments
Post a Comment