Results 1 to 16 of 16

Thread: Creating super large forms

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2015
    Posts
    80

    Creating super large forms

    Hello,

    I am creating a program and it has a lot of text boxes and labels.

    However, the problem is I have reached the limit of the form height (1100).

    So how do I proceed to adding more components?
    Or should I add the next button that will open the next page or so in my form (which I have no idea how to do, can someone enlighten me?)?

  2. #2
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Creating super large forms

    Without knowing more about exactly what the form does, the controls and their contents or anything at all it is hard to say exactly what you could do next....

    However have you considered using something like a tab control to group related controls together and allow a user to see a more focused subset of controls at any one time? Does all the information need to be on screen at once or could some of these controls be moved to a pop-up or a separate form entirely?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2015
    Posts
    80

    Re: Creating super large forms

    Quote Originally Posted by PlausiblyDamp View Post
    Without knowing more about exactly what the form does, the controls and their contents or anything at all it is hard to say exactly what you could do next....

    However have you considered using something like a tab control to group related controls together and allow a user to see a more focused subset of controls at any one time? Does all the information need to be on screen at once or could some of these controls be moved to a pop-up or a separate form entirely?


    I am already using a tab control. Should I use a tab control within a tab control?
    All the information is not necessary to be displayed on the same screen at a time.

  4. #4
    Fanatic Member kpmc's Avatar
    Join Date
    Sep 2017
    Posts
    1,012

    Re: Creating super large forms

    Scrollbars?

  5. #5
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Creating super large forms

    Quote Originally Posted by lolcocks View Post
    I am already using a tab control. Should I use a tab control within a tab control?
    All the information is not necessary to be displayed on the same screen at a time.
    Tab controls inside tab controls generally look pretty horrible and confusing - finding anything becomes more like guesswork.

    Would it be possible for you to show a screenshot or two? Failing that could you give an idea of what is on each tab?

  6. #6
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    Re: Creating super large forms

    Well, there are a few ways to answer this.

    The first is the approach PlausiblyDamp is taking: finding out why you want to put so much on one form it can't fit on the monitor.

    We ask this because large forms with many controls are both difficult to use and can end up being very big memory hogs. The most common reason someone asks questions like this is they're trying to design a grid-like control. However, real grid controls don't use thousands of TextBoxes, they draw a grid and substitute in TextBoxes when they need them. This is complex to explain and you may not even need it. So we need to know more.

    The second approach is to assume you have a good reason.

    We use scrollbars when the form gets too big, but these aren't always designer-friendly. The thing is, at design-time, it's awkward and sometimes impossible to interact with the scroll bars. Not to mention dragging dozens of controls and manually aligning them is a nightmare. So when we have really large UIs like this we tend to programmatically create and place the controls to save our sanity. Much like the concepts I mentioned related to grid-like controls, it takes some working knowledge of WinForms to get there and solutions can vary.

    So we need to know what the thing you're trying to create looks like, then we can make suggestions about how it should be accomplished.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2015
    Posts
    80

    Re: Creating super large forms

    Sorry about the late reply, I just got home and opened the project again,

    Here's a screenshot of what I am making for the client:


    https://s10.postimg.org/kawkb5p87/screen.png


    He will be filling out all this data and on the press of a button the result will be calculated and he can get a print out of it.
    I need to add more controls on the bottom but as you can see I have run out of space. The maximum height Visual Studio 2017 will allow me to implement is 1100, and that form has reached it's 1100 limit.

    https://postimg.org/image/hyokd2rx1/


    I have already activated autoscroll, problem is, to get the scroll bar to activate I need to add more components down below the limit but that's not possible to do since I have reached the max form height limit in Visual Studio 2017 (https://postimg.org/image/hyokd2rx1/).


    How can I add controls down below, my client just said it would be better if he get's to see the whole data on one page with a scroll bar instead of a next and back button. But if there is no alternative, I guess I will convince him to work with a next and back button.


    Quote Originally Posted by kpmc View Post
    Scrollbars?
    Already using autoscroll, need to add components below the form height limit to enable the scroll bar.


    Quote Originally Posted by PlausiblyDamp View Post
    Tab controls inside tab controls generally look pretty horrible and confusing - finding anything becomes more like guesswork.

    Would it be possible for you to show a screenshot or two? Failing that could you give an idea of what is on each tab?
    Sorry about the late reply, here's a screenshot.

    https://s10.postimg.org/kawkb5p87/screen.png


    Quote Originally Posted by Sitten Spynne View Post
    Well, there are a few ways to answer this.

    The first is the approach PlausiblyDamp is taking: finding out why you want to put so much on one form it can't fit on the monitor.

    We ask this because large forms with many controls are both difficult to use and can end up being very big memory hogs. The most common reason someone asks questions like this is they're trying to design a grid-like control. However, real grid controls don't use thousands of TextBoxes, they draw a grid and substitute in TextBoxes when they need them. This is complex to explain and you may not even need it. So we need to know more.

    The second approach is to assume you have a good reason.

    We use scrollbars when the form gets too big, but these aren't always designer-friendly. The thing is, at design-time, it's awkward and sometimes impossible to interact with the scroll bars. Not to mention dragging dozens of controls and manually aligning them is a nightmare. So when we have really large UIs like this we tend to programmatically create and place the controls to save our sanity. Much like the concepts I mentioned related to grid-like controls, it takes some working knowledge of WinForms to get there and solutions can vary.

    So we need to know what the thing you're trying to create looks like, then we can make suggestions about how it should be accomplished.

    Hmmmmm.
    Well here's a screenshot of what's been done so far, I hope there's a way out of this one.
    https://s10.postimg.org/kawkb5p87/screen.png

  8. #8
    Addicted Member Goggy's Avatar
    Join Date
    Oct 2017
    Posts
    196

    Re: Creating super large forms

    How about using a grid (datagridview), instead of the lose textboxes?
    In mho they look better and take up less space....
    Utterly useless, but always willing to help

    As a finishing touch god created the dutch

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2015
    Posts
    80

    Re: Creating super large forms

    Quote Originally Posted by Goggy View Post
    How about using a grid (datagridview), instead of the lose textboxes?
    In mho they look better and take up less space....

    That pretty much limits all the designing options.
    My client would probably be pissed if I provide him a grid to input all the data.

  10. #10
    Fanatic Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    518

    Re: Creating super large forms

    Quote Originally Posted by lolcocks View Post
    The maximum height Visual Studio 2017 will allow me to implement is 1100, and that form has reached it's 1100 limit.
    That sound weird; what is the value of your MaximumSize property?
    Name:  form height 1100.png
Views: 155
Size:  4.5 KB

    Just did a quick test and set my form's height to 200k without any issues...

    vb.net Code:
    1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles...
    2.     Me.Height = 200000
    3.  
    4. End Sub
    5.  
    6. ' Since the .Height and .Width properties are Integers, I guess the
    7. ' theoretical maximum size for any form would be pretty damn huge :p
    Last edited by Arve K.; Mar 10th, 2018 at 01:43 PM.
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2015
    Posts
    80

    Re: Creating super large forms

    Quote Originally Posted by Arve K. View Post
    That sound weird; what is the value of your MaximumSize property?
    Name:  form height 1100.png
Views: 155
Size:  4.5 KB

    Just did a quick test and set my form's height to 200k without any issues...

    vb.net Code:
    1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles...
    2.     Me.Height = 200000
    3.  
    4. End Sub
    5.  
    6. ' Since the .Height and .Width properties are Integers, I guess the
    7. ' theoretical maximum size for any form would be pretty damn huge :p


    Name:  Untitled.png
Views: 153
Size:  12.7 KB


    Same as yours.
    Problem is not resizing the form after execution of the program, problem is resizing the form in VB.net's designing part. I cannot extend the form even further to add more components to it cause as you can see in the screenshot above it has reached it's max height of 1100. Even manually inputting the height doesn't help.

    See: https://postimg.org/image/hyokd2rx1/

  12. #12
    Fanatic Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    518

    Re: Creating super large forms

    Hopefully, you will find the solution to your problem here.
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

  13. #13
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Creating super large forms

    One option you might try is putting controls onto panels. As long as the backcolor of the panels is the same as the form, it would look like they were on the form. During design time, you can move those panels to the very edge of the screen, which would effectively increase the size of the area you can work on, because you can design on a series of panels. As you finish what you need on one panel, you could move it mostly off the screen, then work on the next panel. At runtime, you'd put them together like a collage. This effectively quadruples the area you can work with, but is otherwise a pretty stupid idea, cause it changes the organization of the controls and adds a few more controls onto a form that is already going to be straining under the weight of the controls you are using.
    My usual boring signature: Nothing

  14. #14
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: Creating super large forms

    I'm not sure what the problem is.
    I have autoscroll turned on.
    If I drag a control, such as a button partially off the bottom of the form, a scrollbar is added to the right. I can drag the scrollbar, and then move the button further off the form (not completely off) and then move the scrollbar to shift the form up.

    For convenience, I would just put a horizontally narrow button on the form near the bottom of the form. I would then drag the bottom of the button (increasing its height) off the bottom of the form as far as I wanted, and you should see the scroll bar thumb shrink in size to allow you to access that portion of the form.
    Add all the controls you want in the lower exposed portion of the form.
    Once you have all the controls you want, you can delete the convenience button since the form will autoscroll however much it needs to show the lowest control on the form.

    At least that's the way it worked in VS2010. I wouldn't think that VS2017 IDE would be much different in that regard.
    Last edited by passel; Mar 10th, 2018 at 10:08 PM.

  15. #15
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    Re: Creating super large forms

    I agree with passel, I've never found that VS enforces an (unreasonable) maximum on Form size, but sometimes you do have to resort to tricks to get it to work. Assuming you have the form configured to auto-use a scrollbar, if you drag controls slightly off the edge it tends to grow. The trick to larger-scale design, I always found, was changing Size to be larger, setting the Form up how I wanted it, then changing Size back to what I wanted.

    Then I learned the best last step after that is to eat a bunch of tide pods and slam my head in a car door a few times, because forms that need scrollbars to navigate tend to be a nightmare.

    Here's some specific feedback.

    First, more than 80% of your form is blank space. Maybe you think it looks nice to put nearly two physical inches between every group of controls, but it's not. TextBoxes have borders, that border is enough to tell users where one ends and the other begins. 8-12px is often enough horizontal padding. Next I hear you saying "but the vertical space is needed, right? No. That's why we have GroupBox, the border helps distinguish "areas" where groups of controls have logical meaning.

    If you replaced every "section" of this form with a grid control, you could easily fit the first two sections on an old-as-heck 640x480 monitor without loss of legibility. But.

    But I get the feeling looking at it this isn't really a grid. I think you intend for each row to be something unique, and perhaps there are labels missing under "Field Measurements" that would help reveal. I get this feeling because of what the "Pump Data" area looks like, combined with how some "UNIT" labels are pre-populated and rows 6-8 in "Field Measurements" are different from the rest.

    That makes it hard to give specific feedback, because I don't know your domain, but it ought to be easy to compress this form.

    The design also raises weird questions. Why do "Make" and "Model" have three inputs? It feels like that layout probably makes sense for rows like "Pipe Thickness", but it feels like those are probably 1-value fields.

    I think "solving" this problem for you amounts to billable work. I need answers to too many questions to make a suggestion. But I strongly believe there's no reason for this form to be so large, and a workflow (perhaps with editor dialogs) would be both more legible and look more professional. But we need a lot of rounds of 20 questions to get there. I can try to spend some time to mock up some UI examples but it might be tomorrow evening and it definitely won't be "exactly your data". My experience is when I make examples based on guesses of what people want, they get so caught up in telling me why my guess was wrong they don't even seen the example.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  16. #16
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    Re: Creating super large forms

    I spent most of the day on this, I had a lot of free time and for some reason the problem was fun! Please take a look and see what I mean. My UI fits in a very small area, but you can see how it could expand to have multiple columns like yours but not need so much space.

    (The forums choked on an animated gif, so have an imgur link instead: https://imgur.com/a/kWrY4)
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

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