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)??

Hi,

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

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!!

Have a look at this


pG

commented: Good Work +5

Good Work Here PG

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.