Making controls inside a panel auto-slide

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??
LVL 3
mte01Asked:
Who is Participating?
 
RobertRFreemanConnect With a Mentor Commented:
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
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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
 
mte01Author Commented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
boweebleCommented:
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
 
boweebleCommented:
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
 
mte01Author Commented:
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
 
boweebleCommented:
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
 
mte01Author Commented:
It didn't....it moved the control to the upper or leftmost part of the form beyond view.
0
 
boweebleCommented:
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
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
0
 
mte01Author Commented:
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
 
mte01Author Commented:
Ok...I will check this....and inform you of the results....
0
 
mte01Author Commented:
It worked.....AutoScrollMinSize.....thanks!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.