Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewport and Userdocument

Status
Not open for further replies.

fordtran

Programmer
Jun 15, 2005
101
ZA
I wish to make three viewports on a form to preview a model in the three views (plan and two elevations)
I can do each one alone on a whole form, but need to show all three views simultaneously.
For this I need to set up viewports, but I can't use the setviewport method as a form does not support it.
The help refers to using a Userdocument which I know nothing about.
Can someone please help.
Thanks


fordtran
 
re your <<I can do each one alone on a whole form>> I guess you have been drawing your views on the form background.

To have all three views on one form a good approach would be to place three PictureBoxes on the form and draw a view to each of them.

HTH Hugh,

 
Hi Hugh
That is a possibility I can consider, but my next step would be to print these viewports to the printer and there I do not have the luxury of picture boxes.


fordtran
 
Your print routines should be wrapped in a Sub which passes the print object. Otherwise you need two routines one for the picture boxes and one for the printer.

So you would make a Sub like;

Sub DrawViewOne(PrintDev as Object)

PrintDev.Print "View One"
'the rest of your code to draw the view using PrintDev. as the target object follows

End Sub

Then you call the Sub with;

DrawViewOne(Printer)

To put the view on the default Printer or;

DrawViewOne(Picture1)

To put the view on the Picture1 PictureBox.

HTH Hugh,







 
re my;

DrawViewOne(Printer)
DrawViewOne(Picture1)

should have been

DrawViewOne Printer
DrawViewOne Picture1

Hugh

 
I am moving this to the graphics forum

fordtran
 
Um, if you want to know more about UserDocument objects, try googling to "activex document". You'll find a good deal of information.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top