| | |
how to pass a form to another form
Thread Solved |
•
•
Join Date: Jul 2006
Posts: 21
Reputation:
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 11:56 am.
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
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
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.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public intCopies as integer
Instead of using Dim, use Public
On Form1, under the Button - Click
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
intCopies = txtCopies.text
On Form2, under Load
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
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
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
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:
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: Jul 2006
Posts: 21
Reputation:
Solved Threads: 1
Thanx bro. purplegerbil it works thanx alot
![]() |
Similar Threads
- passing values of Select box from JSP to Action class thru form Bean (JSP)
- 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)
- 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: USING CLASSES in VB6
- Next Thread: Code examples for events (e.g. buttons) for a newbie
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






