Results 1 to 34 of 34

Thread: many controls in the screen How how do I fit

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    many controls in the screen How how do I fit

    Hi

    what better way to solve when we have many controls on the screen and no longer fit the screen size


    Are there some way , without to use without using third-party products?


    tia

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: many controls in the screen How how do I fit

    Multiple forms, hidden/unhidden frames/tabs....

  3. #3
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: many controls in the screen How how do I fit

    Depending upon what you are doing, the SSTAB control is probably a very good option....in your browser, notice how going from one tab to another gives you a new 'screen'...if you can group your controls in different 'topics', each topic could be in a new tab....check it out.

  4. #4

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Re: many controls in the screen How how do I fit

    Thank you all
    the screen already a sstab and other controls
    like
    Name:  tela.jpg
Views: 413
Size:  77.3 KB

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: many controls in the screen How how do I fit

    Not good at Portuguese, so don't fully understand the labels on your form. What it looks like to me is that you simply need to group certain functions/inputs into different areas and divide your form into even more tabs. Like it appears you might be able to place the top half in a tab, the bottom in another (with tabs in IT).

    Maybe instructions at the top to lead a user through tab1, tab2, etc...only showing those controls necessary to complete certain 'steps'. It's just a matter of reorganizing both your thought process and the form.

    If you don't want to do tabs, use frames, again, 'walking' a user through step by step, showing/hiding frames as necessary...but I still think you can reorganize this pretty easily into tabs.

  6. #6
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: many controls in the screen How how do I fit

    You could put all your controls inside a picturebox and make that picturebox as 'tall' as you like. Give it (the picturebox) a scrollbar and the user can then move up and down your form.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  7. #7
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: many controls in the screen How how do I fit

    Quote Originally Posted by ColinE66 View Post
    You could put all your controls inside a picturebox and make that picturebox as 'tall' as you like. Give it (the picturebox) a scrollbar and the user can then move up and down your form.
    I like that option....maybe I'll use it in one of MY projects someday...good suggestion.

  8. #8
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: many controls in the screen How how do I fit

    Probably the most simple option is to use a MDI structure. Create a MDI form as the main parent form for the project and make the form in question a MDI Child form. The parent window will auto display scroll bars when needed

  9. #9

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Re: many controls in the screen How how do I fit

    Quote Originally Posted by DataMiser View Post
    Probably the most simple option is to use a MDI structure. Create a MDI form as the main parent form for the project and make the form in question a MDI Child form. The parent window will auto display scroll bars when needed
    Thank you
    Can I to use MDI only this form ?, in the project no exists MDI FORM , I would like if can I to add a MDI form and to use only ths form
    and How can I to put MDI FORM and MDI child in the center screen

    Tia

  10. #10
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: many controls in the screen How how do I fit

    To center on screen you can use some simple math to calculate where the left and top position should be set. I'm sure you can find examples if you try a search.

  11. #11
    Lively Member
    Join Date
    Apr 2015
    Posts
    120

    Re: many controls in the screen How how do I fit

    Quote Originally Posted by ColinE66 View Post
    You could put all your controls inside a picturebox and make that picturebox as 'tall' as you like. Give it (the picturebox) a scrollbar and the user can then move up and down your form.
    My favorite way too.
    Or the variation with an array of picture boxes , all with the same size , at the same location , and only one of them visible at a time.

  12. #12
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: many controls in the screen How how do I fit

    Hidden fields construct a confusing screen. I use in 2000 a simple solution using html forms and display them filing from database and leaving some form elements to make new entries, and button to send (in M2000 interpreter I have the same system for using html forms for input data). So using html you can print easy, you can display tables of information, you may have part of screen loading info from net, and can fit in any screen, any ratio. Opening a new form in a form is easy. You can use javascript to evaluate input before sending back.

  13. #13
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: many controls in the screen How how do I fit

    When using picturebox how do you keep the VScroll1.Value and the Picture1.Top in correct alignment with each other when user changes the height of the Form?

    Code:
    Private Sub Form_Resize()
     Picture1.Move 0, 0, Form1.ScaleWidth - 370, Form1.ScaleHeight * 3
    
     VScroll1.Left = Picture1.Width + 30
     VScroll1.Height = Form1.ScaleHeight - 30
      
     VScroll1.Max = Abs(Form1.ScaleHeight - Picture1.ScaleHeight)
     VScroll1.LargeChange = VScroll1.Max / 10
     VScroll1.SmallChange = VScroll1.Max / 100
    End Sub
    
    Private Sub VScroll1_Change()
     VScroll1_Scroll
    End Sub
    
    Private Sub VScroll1_Scroll()
     Picture1.Top = -VScroll1.Value
    End Sub
    When the app first starts everything works correctly. As you scroll up and down the picturebox moves in alignment so when the scrollbar is at the bottom you see the controls at the bottom of the picturebox. Now, change the height of the Form to something smaller and now the scrollbar no longer scrolls to the bottom of the picturebox


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  14. #14
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: many controls in the screen How how do I fit

    a non-sizeble form can have (almost) any size you want
    make this form an mdi-child,and you have a very big form that you can scroll/pan all you want
    only 1 caveat: you'll have to position the controls at run-time

    if you want to position the controls at design time,use a picture box the size you want
    and place it on a mdi-child,and size the mdi-child at run time to the size of the picturebox

    have a look at post #27 for a way to do it at design time
    Last edited by IkkeEnGij; Aug 30th, 2015 at 10:08 AM. Reason: found a way to do it
    do not put off till tomorrow what you can put off forever

  15. #15
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: many controls in the screen How how do I fit

    Quote Originally Posted by IkkeEnGij View Post
    a non-sizeble form can have (almost) any size you want
    make this form an mdi-child,and you have a very big form that you can scroll/pan all you want
    only 1 caveat: you'll have to position the controls at run-time

    if you want to position the controls at design time,use a picture box the size you want
    and place it on a mdi-child,and size the mdi-child at run time to the size of the picturebox
    Why would you need to position the controls at run time? I can't think of a reason this would be required unless possibly because the res of the development monitor is to low to display the form in the IDE and even then you would only need to position the ones that would be past the limits of the display in the IDE

  16. #16
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: many controls in the screen How how do I fit

    Quote Originally Posted by jmsrickland View Post
    When using picturebox how do you keep the VScroll1.Value and the Picture1.Top in correct alignment with each other when user changes the height of the Form?

    Code:
    Private Sub Form_Resize()
     Picture1.Move 0, 0, Form1.ScaleWidth - 370, Form1.ScaleHeight * 3
    
     VScroll1.Left = Picture1.Width + 30
     VScroll1.Height = Form1.ScaleHeight - 30
      
     VScroll1.Max = Abs(Form1.ScaleHeight - Picture1.ScaleHeight)
     VScroll1.LargeChange = VScroll1.Max / 10
     VScroll1.SmallChange = VScroll1.Max / 100
    End Sub
    
    Private Sub VScroll1_Change()
     VScroll1_Scroll
    End Sub
    
    Private Sub VScroll1_Scroll()
     Picture1.Top = -VScroll1.Value
    End Sub
    When the app first starts everything works correctly. As you scroll up and down the picturebox moves in alignment so when the scrollbar is at the bottom you see the controls at the bottom of the picturebox. Now, change the height of the Form to something smaller and now the scrollbar no longer scrolls to the bottom of the picturebox

    I don't know what it is that you are trying to achieve by resizing the picture box when the form resizes so i won't attempt to answer your question until you can explain that, please. the idea is that the picture box is a fixed, constant size?
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  17. #17
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: many controls in the screen How how do I fit

    You're right. I copied this code from a thread here some time back so I don't why the original author put in a height in the following line

    Picture1.Move 0, 0, Form1.ScaleWidth - 370, Form1.ScaleHeight * 3

    but when I remove it everything works fine

    Picture1.Move 0, 0, Form1.ScaleWidth - 370

    Thanks, Colin


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  18. #18
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: many controls in the screen How how do I fit

    DataMiser,
    thank you, for reminding me, that one can put controls on a form at designtime, thank you
    may i remind you to read the question ???
    do not put off till tomorrow what you can put off forever

  19. #19
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    679

    Re: many controls in the screen How how do I fit

    To save a display space...

    One thing you can do, is to make textboxes height bit smaller, VB IDE usually reserves bit too much vertical space for the textbox vs. fontsize defined.

    For example; if you use 10 point MS Sans Serif. VB IDE reserves 24 (360/15) pixels vertical space in 96 DPI display systems.

    You can lower height 3 px per textbox, by first setting fontsize to 8 point and then adjusting textbox height to 21 pixels / 315 twips (96 DPI systems) and lastly setting fontsize back to 10 points.

    Other thing.... frameless textboxes, could be positioned vertically in few pixels limited ie. above of each others.

  20. #20
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: many controls in the screen How how do I fit

    Been designing (and inspecting others') user input screens for decades. A cluttered form like OP presented is NOT-user friendly. Hard on the eyes, confusing to the brain. Even if one uses a scrolling picturebox (which is cool in its own right), a lot of input/output display controls overwhelms users, even experienced ones.

    I HIGHLY suggest OP look at 'dividing' this type of form into multiple 'somethings'. TABS really do work well, as do multiple forms. It is a matter of organizing the information in an easy to follow format...going from one tab/form to the next with minimal necessary display items on each.

    Use a Turbo-Tax sort of mindset (As you are not in the US, Turbo-Tax is a walkthrough application for us US citizens to pay mega-bucks in taxes to our govenment every year). You probably have something similar there....I just went to Calcule.Net and watch a video on how to pay taxes in Brazil....step by step...each page was not overly cluttered. You might think like that....keep it simple and walk your user through the process.

  21. #21
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: many controls in the screen How how do I fit

    Agree. I think OP's Form is far too cluttered. The minute I saw it I had a slight heart attack. Sure wouldn't want to be a user of this one


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  22. #22
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: many controls in the screen How how do I fit

    I to do agree, i think tab control is the best solution
    i also explained here clearly, how you can have a form, of almost any size, that can be scrolled/panned, without any code to do it
    also a form with 2 splitters could give the possibility to have 4 rectangles, that could contain controls
    kind of 4 forms in 1 form where each of these 4 could be (almost) as large as a (normal) form
    yet another possibility would be a mdi interface with as many children as you want
    but the OP has to deside

    just remember that simply making a form a mdi-child will not enlarge it
    do not put off till tomorrow what you can put off forever

  23. #23
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: many controls in the screen How how do I fit

    Quote Originally Posted by IkkeEnGij View Post
    DataMiser,
    thank you, for reminding me, that one can put controls on a form at designtime, thank you
    may i remind you to read the question ???
    I did read the question and I saw the form. There is no indication if this form is to large on the development PC or if it is a client PC that has a lower res that is a problem. At any rate the post I responded to made it sound like to use a MDI you would have to position all of the controls at run time and that is simply not the case. Some maybe depending on the res of the development pc to the final size of the form and maybe none at all.

    In any case I would modify the form in the IDE so that it would not be larger than the lowest res I want to target and make changes accordingly. It appears the bottom part of the form is in a frame. It would be possible to make the form considerably shorter and place a toggle of some sort on the form so that the frame would overlay the upper part of the form when needed and would disappear when not needed. Would be just a couple of lines of code and would solve the issue unless all of that info must remain visible. IMO there is far to much info on that screen already so the design really needs to be reconsidered.

  24. #24
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: many controls in the screen How how do I fit

    Yes, in spite of my offering a suggestion to the problem as described, I tend to agree that, from a design point-of-view, cluttered/busy interfaces should be avoided when possible as they tend to be intimidating to users. Breaking down what needs to be collected (data-wise) into logical groupings of related chunks is more user-friendly and (usually) more developer-friendly as you can trap and report data-entry issues in a more structured and coherent manner (and hence write more maintainable code).
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  25. #25
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: many controls in the screen How how do I fit

    Simple forms with next previous buttons is the best, using frame and without tabs...but it is good to monitoring the actions so maybe these frames are in lower half and in upper half maybe we see a collection of info without buttons ...just info.

  26. #26
    gibra
    Guest

    Re: many controls in the screen How how do I fit

    Quote Originally Posted by mutley View Post
    Thank you all
    the screen already a sstab and other controls
    like
    Name:  tela.jpg
Views: 413
Size:  77.3 KB
    Hard to recommend without knowing exactly the business logic, because it is not just a matter of place controls, but position them using a relevance logic.

    For example, I would add another SSTab father, with two tabs:
    The first tab General contains the top half of the controls on your form.
    The second tab contains Resumo de cálculo.
    In this way you make free the 50% of space.

    But I have no idea if this has a 'logic' that meets the needs of the operator to use the form.


  27. #27
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: many controls in the screen How how do I fit

    Quote Originally Posted by IkkeEnGij View Post
    a non-sizeble form can have (almost) any size you want
    make this form an mdi-child,and you have a very big form that you can scroll/pan all you want
    only 1 caveat: you'll have to position the controls at run-time

    if you want to position the controls at design time,use a picture box the size you want
    and place it on a mdi-child,and size the mdi-child at run time to the size of the picturebox
    on second thought :
    if a non-resisable mdi-child can, at run time, size itself to sizes far greater than the screen
    and a non mdi-child cannot
    then maybe,it is the mdi-form that makes it possible

    if we could have,at design-time, a form thats seated in a mdi-form
    then maybe that form could be sized far greater than the screen
    and we could at design-time place controls anywhere on the form

    turns out it can be done
    i just never thought of it (i always use VB with its SDI interface)
    just use VB with its MDI interface, and it can be done

    so,one could have a form with a height of say 10 times the height of the screen
    and place anywhere controls on that form at design time
    do not put off till tomorrow what you can put off forever

  28. #28
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: many controls in the screen How how do I fit

    What's the point of that? How are you going to see the controls on the Form that is beyond the screen?


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  29. #29
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: many controls in the screen How how do I fit

    Quote Originally Posted by jmsrickland View Post
    What's the point of that? How are you going to see the controls on the Form that is beyond the screen?
    all you have to do is scroll the form with the automatic scrollbars of the mdi-form
    see post #6 by ColinE66
    that SamOscarBrown likes so much in post #7
    and you refer to in post #13
    one can achieve the exact same effect
    without a picturebox
    without scrollbars
    with 0 (zero) code
    do not put off till tomorrow what you can put off forever

  30. #30
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: many controls in the screen How how do I fit

    I don't use mdi so I didn't know it had that feature. Can you post example sounds like a good idea


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  31. #31
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: many controls in the screen How how do I fit

    put vb in its MDI interface
    Tools-Options-Advanced
    if Option 'SDI Development Environment' is checked then uncheck it and the next time vb starts it will use its

    MDI Development Environment

    when vb is in its MDI mode:
    it will show an MDI-form with in it a normal form (Form1)
    chance Form1's borderstyle to 1-Fixed Single
    change it's height to 100000
    immediately the (vb's) MDI-form will show a scrollbar
    you can now scroll Form1 up-down over the entire 100000 twips
    and you can place controls anywhere over its entire surface
    if you now run the program, you will not be able to see its entire surface
    thats normal because Form1 is not an MDI-child
    make Form1 an MDI-child
    if you now run the program vb will complain that there is no MDI-form
    add a MDI-Form
    run the program
    thats it
    do not put off till tomorrow what you can put off forever

  32. #32
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: many controls in the screen How how do I fit

    OK, I found an MDI. I made it 40000. It does seem to work quite well/

    There is one thing I don't care for. however. The Form does not scroll with the scrollbar; it waits until you stop scrolling but with a picturebox it scrolls with the scrollbar


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  33. #33
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: many controls in the screen How how do I fit

    indeed, thats standard behaviour of mdi-forms in vb6 (vb6 shows its age)
    but that is only if you move the scroller of the mdi scrollbar
    if you hold down the upper/lower arrow of the mdi scrollbar,it will scroll smoothly
    also if you click/hold down the mouse over the scrollspace not occupied by the scroller,it will scroll smoothly

    in that respect a picturebox/scrollbar may have a slight advantage
    but the standard behaviour means no code at all (hence no code that may have side effects)
    and best of all it has a scroll range thats far greater the a standard vb scrollbar
    if you have a picturebox that say is 100000 twips heigh, try to tweak the vb scrollbar to make it scroll smoothly

    to see what i mean:
    make the mdi-child autoredraw true and 100000 twips heigh
    Code:
    Private Sub Form_Load()
        For i = 1 To 500
            Print i
        Next
    End Sub
    make the picturebox autoredraw true and 100000 twips heigh
    Code:
    Private Sub Form_Load()
        For i = 1 To 500
            picturebox.print i
        Next
    End Sub
    try scrolling, and see the difference
    the mdi scrollbars will just work
    the vb scrollbars will have to be tweaked to cover that range (and hence will be jumpy)
    do not put off till tomorrow what you can put off forever

  34. #34

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Re: many controls in the screen How how do I fit

    Thank you all,

    How can I to Increase MDI parent according MDI child, In resume I want to change HEIGHT, WIDTH of the MDI Parent according height and widith Child

Tags for this Thread

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