Results 1 to 11 of 11

Thread: Possibillity to create a form size greater then screen size

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    Hello VB users,

    I am trying to create a form size greater then screen size.
    For example to create a area of a big factory.
    To move to a part what is not on the screen you have to use a scroll bar.

    Is this possible? If yes, how do I do this?

    Nice regards,

    Michelle.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Well, you can't or shouldn't make the form it self bigger then the screen. The content of the form may be bigger though.

    Add a PictureBox to the form and set it to the size you want the form to have. Add the controls you need to the PictureBox container and then add scrollbars to the form.

    Calculate the scrollbars max value by substracting the PictureBox width/height with the forms width/height (this calculation should be done in the Form_Resize event).

    Now just move the PictureBox when the scrollbars changes value.

    Good luck!

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    what you could do is place a picturebox on a form and position it using scroll bars

    take a look at my earlier posting

    http://forums.vb-world.net/showthrea...threadid=11227
    Mark
    -------------------

  4. #4
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Not in the sense that the form can be bigger than the screen. You need to use picture boxes.

    - Lets say your form is the size of the screen.
    - Place a horizontal and vertical scroll bar on the edges of the form.
    -Place A picture box the remaingin size of the form on the form.
    -Place a second picture box inside the 1st one
    -Place all of your controls in the 2nd picture box.
    -The 2nd picture box can be bigger than the 1st picture box.
    -place the following code in the scroll bars. You can change it make it smoother.

    Code:
    Private Sub HScroll1_Change()
        Picture2.Left = -HScroll1
    End Sub
    
    Private Sub HScroll1_Scroll()
        HScroll1_Change
    End Sub
    
    Private Sub VScroll1_Change()
        Picture2.Top = -VScroll1
    End Sub
    
    Private Sub VScroll1_Scroll()
        VScroll1_Change
    End Sub
    Good Luck.

    Regards.
    Iain, thats with an i by the way!

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    Thanks for the answers, but I need also object functionallity. On a picture you can't place a TextBox!

    Nice greetings,

    Michelle.

  6. #6
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Yes you can
    Iain, thats with an i by the way!

  7. #7
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Note that any control can not be larger than screen. What you are suggesting is to simulate it with scollbars and moving controls.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  8. #8
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Originally posted by michelle
    On a picture you can't place a TextBox!
    How told you that? You can add any control to a picturebox.

  9. #9
    Guest
    Or you case change the resolution of the screen, make the form the size of the screen then change it back.

    There are a lot of problems that can arise with this method. (it's just a thought)

  10. #10
    Guest

    You can make a form bigger than the screen!!!!!!!!!!!!!!!!!

    Yeap have seen an asset system with forms bigger than the screen. Not a nice system to use though.

  11. #11
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    No meg, that wont work, it will cut of the parts out of size.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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