INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Reports

How to create a Print Preview toolbar to replace the default one. by mgagnon
Posted: 26 Mar 04

  1. Create a program and place the following code in it.

  2. CODE

    Report Form C:\REPORT3.FRX Preview

    Define Class MyToolBar As Toolbar
        Caption = "Print Preview"
        Add Object cmdTop As CommandButton With;
            caption = "Top"
        Add Object cmdBack As CommandButton With;
            caption = "Previous"
        Add Object cmdNext As CommandButton With;
            caption = "Next"
        Add Object cmdLast As CommandButton With;
            caption = "End"
        Add Object cmdZoom As CommandButton With;
            caption = "Zoom"
        Add Object cmdPrint As CommandButton With;
            caption = "Print"
        Add Object cmdQuit As CommandButton With;
            caption = "Quit"
        Procedure cmdTop.Click
        Keyboard "{HOME}"
        Endproc
        Procedure cmdBack.Click
        Keyboard "{PGUP}"
        Endproc
        Procedure cmdNext.Click
        Keyboard "{PGDN}"
        Endproc
        Procedure cmdLast.Click
        Keyboard "{END}"
        Endproc
        Procedure cmdQuit.Click
        Keyboard "{ESC}"
        This.Parent.Release()
        Endproc
        Procedure cmdZoom.Click
        Keyboard "Z"
        Endproc

    Enddefine

    Procedure removeWindow
    If Wexist("Print Preview")
        Deactivate Window "Print Preview"
    Endif
    Endproc

  3. In the init of the dataenviroment of the report, put the following:

  4. CODE

    Public oTbr
    oTbr = Createobject("MyToolBar")
    oTbr.Visible = .T.

  5. In the "On entry" band of the page header of the report, put :

  6. CODE

    removeWindow()

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close