Results 1 to 2 of 2

Thread: Create long form

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Mesa, Az, USA
    Posts
    2

    Post

    I would like to create a data entry screen that's similar to turbo tax form, which scroll more than full screen. Will anyone have any suggestion how to do it on VB6. Any suggestion is appreciated.

    Thx.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Here's an Example of using a Picturebox and 2 Scrollbars to create a virtual space as big as the Printer Paper Size..

    On a Form with a Picturebox, a Vertical Scrollbar and a Horizontal Scrollbar..
    Code:
    Private Sub Form_Load()
        Dim sCenter As String
        
        sCenter = "Some Centered Text"
        Picture1.Move VScroll1.Width, 0, Printer.ScaleWidth, Printer.ScaleHeight
        Picture1.BorderStyle = vbBSNone
        Picture1.AutoRedraw = True
        Picture1.Print "Top, Left";
        Picture1.CurrentX = Picture1.Width - 900
        Picture1.Print "Top, Right"
        Picture1.CurrentY = Picture1.Height - 200
        Picture1.Print "Bottom, Left";
        Picture1.CurrentX = Picture1.Width - 1100
        Picture1.Print "Bottom, Right"
        Picture1.CurrentX = (Picture1.Width - Picture1.TextWidth(sCenter)) / 2
        Picture1.CurrentY = (Picture1.Height - Picture1.TextHeight(sCenter)) / 2
        Picture1.Print sCenter
        VScroll1.Max = Picture1.Height - ScaleHeight + HScroll1.Height
        HScroll1.Max = Picture1.Width - ScaleWidth + VScroll1.Width
        Picture1.ZOrder 1
        HScroll1_Change
        VScroll1_Change
    End Sub
    
    Private Sub Form_Resize()
        VScroll1.Move ScaleWidth - VScroll1.Width, 0, VScroll1.Width, ScaleHeight - HScroll1.Height
        HScroll1.Move 0, ScaleHeight - HScroll1.Height, ScaleWidth - VScroll1.Width
    End Sub
    
    Private Sub HScroll1_Change()
        Picture1.Left = -HScroll1
    End Sub
    
    Private Sub HScroll1_Scroll()
        HScroll1_Change
    End Sub
    
    Private Sub VScroll1_Change()
        Picture1.Top = -VScroll1
    End Sub
    
    Private Sub VScroll1_Scroll()
        VScroll1_Change
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


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