home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / abortprn / abortprn.frm (.txt) next >
Visual Basic Form  |  1993-07-26  |  3KB  |  92 lines

  1. frmAbortTest
  2. Print Cancel Demo
  3. Form1%
  4. cmdAbortTest
  5.     Exit Test
  6. cmdAbortTest
  7. Abort Print Job
  8. cmdAbortTest
  9. Start Print Job
  10. Command1_Click
  11. NoPrintMan
  12. EndIt
  13. dummyy
  14. Command2_Click
  15. Printer
  16. Command1
  17. VisibleW
  18. Form_Click
  19. Command2
  20. @    Form_LoadH
  21. EndPrn
  22. Caption
  23. form1A
  24. WaitTime0
  25. defineu
  26. AbortDoc
  27. junkX
  28. ErrorHandler
  29. ErrorHandleer+
  30. AbortJob
  31.     Functions
  32. exampleP
  33. display
  34. messages
  35. associated
  36. numbers
  37. this]
  38. paste%
  39. Declarations
  40. section
  41. press
  42. click
  43.     UserError
  44. PrintCancel
  45. Command3_Click
  46. cmdAbortTest_Click
  47. Index
  48. LineNo
  49. cmdAbortTest
  50. Form_Paint
  51. Screen
  52. Width
  53. Height
  54. frmAbortTest
  55. PageNo>
  56. cmdAbortTest_Click
  57.    Start Print Job
  58.    Set Shared AbortJob to false, it will bel
  59.    reset to true if Abort Job is selected by
  60.    user.
  61.    Set up a small delay so user can see what
  62.    is happening to print job
  63.    Inform the user of what's happening
  64. Printing Page:
  65.  Line:
  66.    Give user a chance to do somethings
  67. Print Job Complete
  68.    Abort Print Job
  69.    Set up a local error handler to handle the error we are going
  70.    to cause shortly.
  71.    Call Windows' AbortDoc function in the GDI libary
  72.    VB's printer object doesn't know you have aborted
  73.    the print job, so when a Printer.EndDoc is issued
  74.    VB is going to give you a printer error.  Issue
  75.    the EndDoc now while you can ignore the error..
  76. Print Job Aborted
  77.             AbortJob = True
  78.    Exit Test
  79.    Exit the sub here so that you don't run into your error handling
  80.    routine. 
  81.  Error handler for VB's printer error.
  82.  This is VB's printer error so
  83.  ignore it!x
  84.  If it's not the printer error
  85.  then inform the user of the error
  86.  and end program execution
  87. Form_Load
  88.    Put form in the middle of the screen
  89.    Let'em know what program they are running
  90. Abort Print Job Test
  91. Form_Paint
  92.