•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 397,803 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,456 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 1787 | Replies: 5 | Solved
![]() |
•
•
Join Date: Jul 2006
Posts: 21
Reputation:
Rep Power: 3
Solved Threads: 1
Hi guys, i have a problem in vb6 .
lets say i have a command button named print in form1 then after clicking the print button it will transfer me to form2 which will control the number of copies,quantity and these things of printing options. The problem is how to pass form1 to form2 and then based on the selection of the user in form2 i will print form1
so how to manipulate form1 in form2 ?? any hints or help
can i pass it as an object(cascading)??
lets say i have a command button named print in form1 then after clicking the print button it will transfer me to form2 which will control the number of copies,quantity and these things of printing options. The problem is how to pass form1 to form2 and then based on the selection of the user in form2 i will print form1
so how to manipulate form1 in form2 ?? any hints or help
can i pass it as an object(cascading)??
Last edited by Comatose : Jul 31st, 2006 at 10:56 am.
•
•
Join Date: Apr 2005
Location: West Yorkshire, England
Posts: 72
Reputation:
Rep Power: 4
Solved Threads: 6
Hi,
A couple of ways you could dop this:
1. From Form2, you could
Thisill copy the text from Text1 on Form 1 to the Label on Form2
2. Add a Module to your script
Within the module define the variables to be used across the two forms.
Instead of using Dim, use Public
On Form1, under the Button - Click
On Form2, under Load
Hope this makes sense.
--BUT--
Why not you the print control to get printing information
Right click the toolbar and select Components
Scroll down the list and tick - Microsoft Comon Dialog Control
Double Click the control to put it onto your form
Under your Print button - Click
You can now use CommonDialog1.copies etc to get the printer info.
Good Luck
pG
A couple of ways you could dop this:
1. From Form2, you could
label1.caption = Form1.Text1.Text
Thisill copy the text from Text1 on Form 1 to the Label on Form2
2. Add a Module to your script
Within the module define the variables to be used across the two forms.
Public intCopies as integer
Instead of using Dim, use Public
On Form1, under the Button - Click
intCopies = txtCopies.text
On Form2, under Load
lblCopies.caption = intCopies
Hope this makes sense.
--BUT--
Why not you the print control to get printing information
Right click the toolbar and select Components
Scroll down the list and tick - Microsoft Comon Dialog Control
Double Click the control to put it onto your form
Under your Print button - Click
CommonDialog1.ShowPrinter
You can now use CommonDialog1.copies etc to get the printer info.
Good Luck
pG
purpleGERBIL
•
•
Join Date: Jul 2006
Posts: 21
Reputation:
Rep Power: 3
Solved Threads: 1
Thanx for replay ,
But when i tried to use this way you wrote
* Right click the toolbar and select Components
Scroll down the list and tick - Microsoft Comon Dialog Control
Double Click the control to put it onto your form
Under your Print button - Click
Code:
CommonDialog1.ShowPrinter
You can now use CommonDialog1.copies etc to get the printer info.
------------------------------------------
BUT when i press the print button it displays the printer info e.g. num of copies and these things. But when i press print then it does not print that means nothing to print nothing goes to the printer. The question is how to specify that i want to print form1 using Microsoft Comon Dialog Control?
i did your steps but still the same problem but when i write in the click event of "print button" form1.printform it prints the specified form eventhough its size is small!!
But when i tried to use this way you wrote
* Right click the toolbar and select Components
Scroll down the list and tick - Microsoft Comon Dialog Control
Double Click the control to put it onto your form
Under your Print button - Click
Code:
CommonDialog1.ShowPrinter
You can now use CommonDialog1.copies etc to get the printer info.
------------------------------------------
BUT when i press the print button it displays the printer info e.g. num of copies and these things. But when i press print then it does not print that means nothing to print nothing goes to the printer. The question is how to specify that i want to print form1 using Microsoft Comon Dialog Control?
i did your steps but still the same problem but when i write in the click event of "print button" form1.printform it prints the specified form eventhough its size is small!!
•
•
Join Date: Apr 2005
Location: West Yorkshire, England
Posts: 72
Reputation:
Rep Power: 4
Solved Threads: 6
•
•
Join Date: Jul 2006
Posts: 21
Reputation:
Rep Power: 3
Solved Threads: 1
Thanx bro. purplegerbil it works thanx alot
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Similar Threads
- How to pass value from locally to globally (ASP.NET)
- How do I pass data in string from a form to another? (Visual Basic 4 / 5 / 6)
- modify script (Perl)
- passing values of Select box from JSP to Action class thru form Bean (JSP)
- email button in mail.body (ASP.NET)
- internet form handling (Python)
- Posting form data to an Oracle database (JavaScript / DHTML / AJAX)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Help with scientific calculator
- Next Thread: Code examples for events (e.g. buttons) for a newbie



Linear Mode