-
January 3rd, 2007, 08:02 AM
#1
Resizing Part II
Ok Folks, thanks for all your help on finding the event. Now the controls are not behaving as I want.
I have a FlowLayoutPanel with properties set as follows:
Locked = false
Dock = none
flowdirection = lefttoright
In the Resize event I have:
Code:
flowLayoutPanel1.Left = this.Left + 20;
When I drag the left side of the form to resize, the FLow Layout jumps varying distances from the left hand edge as opposed to staying constant as I'd expect.
Is there any other properties that are of significance that I have missed?
If you find my answers helpful, dont forget to rate me
-
January 3rd, 2007, 01:33 PM
#2
Re: Resizing Part II
The form.left is referenced to screen coordinates. However the panel.left is referenced to the form's client area.
If you want the panel.left to stay constant, you do not need to change it in the form.resize. You probably do want to change panel.width to correspond to the client area change.
-
January 3rd, 2007, 02:55 PM
#3
-
January 4th, 2007, 04:19 AM
#4
Re: Resizing Part II
I'll have a look at point to client. Zip's, I think you mis-understand.
Yes I will want to change the width of the flowlayout as I increase the width of the form, but I also want the left side of the flow layout to stay a constant distance from the left edge of the form.
When I drag the left edge of the form with no resize event, the gap just increases between the 2 edges. Draging the right hand edge will leave the left edges in tact.
If you find my answers helpful, dont forget to rate me
-
January 4th, 2007, 08:01 AM
#5
Re: Resizing Part II
Ok Folks, I didn't have any luck with pointtoclient.
However I have had limited success setting the flowlayout's AutoSizeMode to GrowAndShrink and then resizeing the treeview control that's on the flowlayout as opposed to the flowlayout control directly. The controls resize ok if I'm expanding the form by Dragging the edge of the form. However, If I attempt to reduce the size of the form it will not reduce.
I thought that it might be because the forms AutoSizeMode was set to GrowOnly, so I changed that to GrowAndShrink as well. However changing that I cant even resize to enlarge now. The form is effectively static ???
Last edited by Bill Crawley; January 9th, 2007 at 07:33 AM.
Reason: Change last comment
If you find my answers helpful, dont forget to rate me
-
January 9th, 2007, 07:35 AM
#6
Re: Resizing Part II
Still have problems here if anyone has anymore ideas
If you find my answers helpful, dont forget to rate me
-
January 9th, 2007, 08:18 AM
#7
Re: Resizing Part II
Add a Panel to the Form. Dock it to the left. Set Dock to Fill for the FlowLayoutPanel. Skip the resize events.
-
January 9th, 2007, 09:12 AM
#8
Re: Resizing Part II
Hi I've added a panel with a couple of text boxes and labels on in and set the Dock to Left. I then moved my flowlayout onto the form so that it wasn't on the Panel and set dock to fill on that.
On the form itself I set AutoSizeMode to GrowAndShrink.
However, I cannot resize the form. I basically want to resize controls proportionally as the user resizes the form manually either enlarging or reducing.
If you find my answers helpful, dont forget to rate me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|