Re-size Print Preview



I have a test program that permits display of the form (preview) at full size using a PictureBox on
the screen. So far so good - it works.

What must I do to permit the user to enlarge the display if something is too small to be read and
they want enlarge it?

What must I do to permit the user to reduce the display and view the entire page on the screen?

Thank you,
Jim Y

Here is some of the code:

===============================

Option Explicit

'switch to determine whether Query or Wedding Query
Public gEventType As Integer
'switch to determine whether screen display or printer copy
Public gScrnPrntr As String 'use Screen or Printer to identify

Private Sub Form_Load()

'gEventType 0 for Wedding Query, 1 for General Query

'NOTE Since the form is in twips, the PictureBox must be positioned
' and sized using twips. In the PictureBox, inches are used.
' Try 1.2 enlargement and 0.6 reduced size (full screen) for form

Pic.ScaleMode = 5 'inches in the PictureBox, Form1 is twips
Pic.Width = 8.5 * 1440 '12,240 twips wide
Pic.Height = 11 * 1440 '15,840 twips high

Pic.Top = 0.25 * 1440 '360 twips wide
Pic.Left = (Screen.Width - Pic.Width) / 2

With VScroll1
.Left = Pic.Left + Pic.Width 'Position VScroll1 on right of Pic
.Top = 0 '1440
.Height = 10360 '7200
.Max = 60 '60% instead of 100% to not go up too far
.LargeChange = 30 'two clicks to scan full page - 60/30=2
.SmallChange = 6 'ten clicks to scan full page - 60/6=10
End With


Private Sub mnuQueryDisplay_Click()

Pic.Cls

gEventType = 1 'for General Query
gScrnPrntr = "Screen" 'use Screen or Printer

Call QueryForms 'in ModDisplay

End Sub


End Sub

==================================================

Public Sub QueryForms()

Dim strPrinted As String 'date & time form was printed - reserved
Dim strPrntStrng As String 'combined items on one line
Dim intEventType As Integer 'Zero (0) for Wedding, One (1) for General
Dim strType As String
Dim Obj As Object 'Form1.Pic or Printer

<SNIP>

'Get Date and time of printing
strPrinted = "Printed: " & Format(Now, "ddd, mmm, dd, yyyy") _
& " " & Format(Now, "hh:mm AM/PM")

If Form1.gScrnPrntr = "Screen" Then
Set Obj = Form1.Pic
ElseIf Form1.gScrnPrntr = "Printer" Then
Set Obj = Printer
Else
Exit Sub
End If

'Get Query/Wedding Query switch
intEventType = Form1.gEventType

'Draw border around the page - 0.62 inch border all around
Obj.DrawWidth = 4
Obj.Line (0.62, 0.62)-(7.88, 10.25), , B

'Print Company Name, Adress and Phone numbers
Obj.FontName = "Arial"
Obj.FontSize = 12
Obj.FontBold = True
Obj.CurrentX = 0.69
Obj.CurrentY = 0.66
Obj.Print "ABCDEFGHIJKLMNOPQRSTUVWXYZQWE"

<SNIP>


.



Relevant Pages

  • RE: Create a "cell button" to hide selected cells.
    ... To avoid cluttering up the worksheet with controls, I used a UserForm. ... The user clicks a button on the worksheet to display a UserForm ... Private Sub cmdSetWeeksToShow_Click ...
    (microsoft.public.excel.worksheet.functions)
  • Re: What am I doing wrong?
    ... I do not like a single display, prefering a Flex Grid to display all of the ... Dim rstCompany As Recordset ... Set rstCompany = Nothing ... Private Sub CmdUpdate_Click ...
    (microsoft.public.vb.database.dao)
  • Re: Hardware hackers rejoice!
    ... I've tried to warm up to Perl ... sub getvar { ... # Given 0, the fan is off. ... # Display to LCD ...
    (Ubuntu)
  • Re: filter a combobox
    ... the reason for IsError is that the CB2 linked cell B3 will display ... "Dave Peterson" wrote: ... > Did you put the code behind the worksheet with the comboboxes? ... >> Private Sub ComboBox2_Change ...
    (microsoft.public.excel.programming)
  • Re: Next & Previous buttons dont display data correctly in Access
    ... The unbound controls remain ... NOTE - it is only display that is incorrect - the database ... > Exit Sub ... > The custom print button is supposed to print of a report version of the ...
    (microsoft.public.access.forms)

Quantcast