I just need to get Printdocument PageCount. I like to get it only with Button_click with in a messagebox. I can get result only if I use with calling PrintPreviewDialog.showDialog windows.