Results 1 to 2 of 2

Thread: Print a SSTab

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    Shannon, Quebec, Canada
    Posts
    251

    Print a SSTab

    Hello,

    I have a SSTab on a form and in this SSTab I have tabs. I want to print (not the form) but the 2 tabs. The first one and after the second tab. Is it possible?? How can I do this?! I don't want to use the printForm, cause it prints all the form and I don't need that.

    Thanks

  2. #2
    jim mcnamara
    Guest
    You can do it using graphics methods. I don't remember if SSTabs have an hDC property, I doubt it. So use the form's hDC and then BitBlt the SSTab to the printer.hDC

    Code:
    Declare Function BitBlt Lib "gdi32" Alias "BitBlt" ( _ 
               ByVal hDestDC As Long, _ 
               ByVal x As Long, _ 
               ByVal y As Long, _ 
               ByVal nWidth As Long, _ 
               ByVal nHeight As Long, _ 
               ByVal hSrcDC As Long, _ 
               ByVal xSrc As Long, _ 
               ByVal ySrc As Long, _ 
               ByVal dwRop As Long _ 
    ) As Long 
    
    Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Long) As Long 
     
    Dim LeftPrinterMargin as long
    
    LeftPrinterMargin = 1200  ' margin from left side...
    ' 7500 twips is about halway up the printer page
    
    ' one-to-one rendering in the middle of the page, not centered
    'VbSrcCopy is a VB constant for a staright copy
    
    Call BitBlt(Printer.hDC, LeftPrinterMargin,  7500, Tab1.Width, _
              Tab1.Height, GetDC(Form1.hWnd), Tab1.Left,Tab1.Top, _
              VbSrcCopy)
    
    Printer.EndDoc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width