Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to have small form for program, but I need a lot of labels, buttons,... to put on. See picture on: http://www.anyfiles.org/2zSM
or see VLC player, it's preferences, select to show all commands and on the right part, you will see it populates many controls and if there's to many of them, it shows scroll bar to go up/down.

- What is the best way to make this working? I would like for user to scroll down and see all labels, buttons, textboxes,...

What is the best way for this for WinForm and for WPF?

What I have tried:

For now I have used multiple tab pages. But I don't like this option, neider do users.
Posted
Updated 22-May-16 4:37am
v3
Comments
Sergey Alexandrovich Kryukov 22-May-16 8:32am    
This is not a valid question. The reason is: it contains an answer in it. You think that tab-based interface is bad, and using scrolling of all the content would improve it. But why do you think so?
In your picture, you don't show anything useful, anything which needs to be improved. When it comes to design, the sample content should be realistic. Think that you don't need design advice, you already have it? Think again.
—SA
Member 4347041 22-May-16 9:47am    
? I don't understand your comment.
I added picture to show that surface is lower than bottom edge of a form and I would like to add controls on this surface (and "under" the form) and have scroll bar.
Please provide print screen of what you suggest I use on a form.
Sergey Alexandrovich Kryukov 22-May-16 13:46pm    
I'm not suggesting anything, because I don't know what should be the content. I suggest you should do some UI design. I understand this is not what you want; you think that you already have some reasonable design and hence don't need to explain the content you want to show, do you only want to know technical means of using scrollable approach. That's why I'm not answering only commenting. Your design won't work from the user experience standpoint; no matter what implementation is.

My advice is: sit down and create some reasonable design.

—SA

You mentioned VLC, but, VLC makes extensive use of menus (top-of-screen unless you select to view full-screen), and context-menus.

If you don't want menus:

I suggest you consider using a SplitterPanel on your Main Form, put your configuration UI in one of the Panels, and your direct-action user interface in the other.

Hide the configuration panel, and give the user an easy way to make it visible when they want to.

Or, you could have another Form with all the configuration controls on it, which you show when the user wants to use it. Using another Form you will have the task of passing-back any choices the user made on the configuration Form to your Main Form. Or, you can have the configuration Form update a static class that both the Main Form and the configuration Form can use.

You can also consider nested splitter panels if you need to, but that, I think, gets you close to the tab ui design you say you don't like.
 
Share this answer
 
v2
Put the controls into a scrollable container.

WPF - ScrollViewer control - see How to: Create a ScrollViewer[^]

Winforms - Panel - see How to: Scroll Form Contents[^]

[EDIT] - In response to the OP's "solution"
To get the controls on there in the first place there are a couple of techniques you can use. For all of them you must have set the AutoScroll property of the panel to True.

1. Make the form and the panel very large in the designer. Position your controls and then resize the form and panel to the desired size.

2. If there are too many controls to do that comfortably in your monitor/workspace then place the controls anywhere within the panel and use the Location property of the controls to position them. You might find this easier if you have a diagram to work from with the positions pre-calculated.

3. An alternative (but not necessarily a good one) is to position the controls (within the panel) programmatically in the Form_Load event - again a diagram will help with this.
 
Share this answer
 
v2
Comments
Member 4347041 22-May-16 9:42am    
Is it possible to do it manually (drag/drop controls)?
Also if I have for example multiple panels, are they stocked one on the other?
CHill60 22-May-16 9:45am    
Do you mean at design time? Yes - just drop them into the panel.
At run time programmatically? Yes - just make sure you add the controls to the panel.
At run time drag/drop - I have no idea - you'll have to try it out.

Positioning of panels is up to you - you can have panels within panels - but you implied that you wanted the whole form to scroll
CHill60 22-May-16 10:41am    
I have updated my solution with some further information

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900