I am getting the below error while migrating from VB6 to VB.Net:
Error 1 'PrintForm1' is not a member of 'System.Windows.Forms.Form'. in the below code:
Public Sub PrintScreen(ByRef frm As System.Windows.Forms.Form, ByRef FormHeight As Short)
'UPGRADE_ISSUE: PrintForm Component might require to be declared. frm.PrintForm1.Print(frm, PowerPacks.Printing.PrintForm.PrintOption.CompatibleModeClientAreaOnly)
End Sub The error is related to the 'System.Windows.Forms.Form' not containing the 'PrintForm1' as its member. In the project, I am sending different forms, with PrintForm Component, to a particular form using the above subroutine. According to the upgrade msg we have to declare the PrintForm1 Component in the subroutine. How can we change this code to get the desired effects?
Jump to Post
You need to download the Power Packs for Visual Basic and install them. Then you sould fint the printform component to add to your form.
Hope this helps
Jump to Post
PrintForm Component might require to be declared.
The form "frm" must have a control that shoud be called PrintForm1.
To add a such control in the form "frm" you can:
1) On the designer of the form add the PrintForm Control
2) On the Load event, or …
All 6 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.