6
Answers

Save File Dialog Box (Auto populating File Name)

Haneef Ahmad

Haneef Ahmad

9y
773
1
I am having a hard time finding solution to this problem, I am trying to save a PDF file using iText Sharp in Windows Form Application however everytime I try to save the file I have to feed the file name manually, What i want to do is that when "Save As" Dialog Box appears the file name should auto populate by concatenating values from 3 different textboxes as a file name.
 
For eg. File Name: CID1CON4INV125 (CID stands for Customer ID which is 1, CON stands for Contract ID which is 4, INV stands for Invoice ID which is 125 and is unique) 
 
Above example may be very tedious to remember if i have to chose a file name everytime, is there a way that i can automate this process by taking the file name from txtCustomerID.Text and txtContractID.Text and txtInvoiceID.Text and prepare a file name to be saved as PDF.
 
Thanks. 
Answers (6)