?
Solved

Making controls inside a panel auto-slide

Posted on 2005-04-21
13
Medium Priority
?
899 Views
Last Modified: 2012-05-05
Hey experts,

I want that upon re-sizing of a panel or a form in a Windows application that the controls inside this panel/form would auto-slide to fit inside the newly sized panel/form......I heard that this is possible upon changing a property inside the panel/form, but I couldn't find it.....any help??
0
Comment
Question by:mte01
  • 6
  • 4
  • 2
  • +1
13 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 13833952
What exactly do you mean by "auto-slide"?

Do you want the panel to be scrollable or do you want the controls to resize so they are proportional to the size of the panel?

If it is the latter then use the Anchor properties of the controls to make them resize as the panel resizes.
0
 
LVL 3

Author Comment

by:mte01
ID: 13835329
By autosliding, I mean that they would move from the right of the panel for example to its bottom upon decreasing the size of the panel from the right.......if you still didn't understand please tell me.....
0
 

Expert Comment

by:boweeble
ID: 13835439
I'm not completely sure if this is what you are wanting, but by setting the "Anchor" property to "Top, Bottom, Right" the control will automatically resize with the window.
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 

Expert Comment

by:boweeble
ID: 13835458
Just to add to my earlier answer, setting the "Anchor" property to "Bottom, Right" will keep the control in the same location with respect to the window as it is resized.
0
 
LVL 3

Author Comment

by:mte01
ID: 13835819
I want themto slide, but I want them to remain visible.....you see behing all this auto-sliding process is to make some controls in a panel that resides in the upper part of a form to remain visible upon re-sizing the form, and not to disappear tothe right (or bottom) when the user re-sizes the form....any help??
0
 

Expert Comment

by:boweeble
ID: 13836380
Setting the "Anchor" property of the control to "Bottom, Right" will keep the control in the same location with respect to the window as it is resized.  This will keep the controls visible...
0
 
LVL 3

Author Comment

by:mte01
ID: 13836601
It didn't....it moved the control to the upper or leftmost part of the form beyond view.
0
 

Expert Comment

by:boweeble
ID: 13836726
Use this as a guideline:

Control Location - Anchor
==================
Upper Right - Top, Right
Lower Right - Bottom, Right
Lower Left - Bottom, Left
Upper Left - Top, Left

If you are using a "Panel", you'll have to set the "Anchor" property for the panel.  If you are also using, say a button on the "Panel", then you'll want to set the "Anchor" property for the button as well.

In addition to the "Anchor" property, there is also a "MinimumSize" property for forms that will prevent your form from be resized to something too small.

I don't have any other suggestions for you.  Hope this helps...
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 13837153
0
 
LVL 3

Author Comment

by:mte01
ID: 13838821
Yes...I followed the guildelines...but still....setting th anchor property does not guarentee that a control or a panel stays within the visible region of the form....this is my problem right now....
0
 
LVL 16

Accepted Solution

by:
RobertRFreeman earned 520 total points
ID: 13847138
If you want the controls to auto-wrap (move to the next line), then Infragistics offers an UltraFlowLayoutManager that will do this.

You should use a scroll bar when the screen is minimized too much or limit the size of the form using the form's minimumsize property.
AutoScroll = true
And then set the AutoScrollMinSize property.

Also the dock properties can be used to position and anchor controls.
0
 
LVL 3

Author Comment

by:mte01
ID: 13848827
Ok...I will check this....and inform you of the results....
0
 
LVL 3

Author Comment

by:mte01
ID: 13889759
It worked.....AutoScrollMinSize.....thanks!!
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question