Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1074
  • Last Modified:

Resize a borderless form with a statusstrip on it.

Hi,
Is it possible to resize a borderless form with a statusstrip on it. And resize the form with the sizegrip of the statusstrip.

 Is there an solution.

Peter Kiers
0
peterkiers
Asked:
peterkiers
  • 2
  • 2
1 Solution
 
Jacques Bourgeois (James Burger)Commented:
If the AutoSize property of the StatusStrip is set to False, dragging the SizingGrip triggers the Resize event. You could follow what happens there to increment or decrement the Form by the same number of pixels.

This being said, this is a strange idea. There are standard in Windows that enable users to understand what they can do just by the look of things, and a borderless form is an indication that it cannot be enlarged. I am not sure that most users would understand that they can enlarge the form by the sizing grip only.

I would rather go for a Form that has its FormBorderStyle set to SizableToolWindow, ControlBox to False, and no Text. This removes the header but leaves a thick border that is, I think, a clearer way to indicate that a Form can be resized.
0
 
peterkiersAuthor Commented:
Could you help me with this:

"If the AutoSize property of the StatusStrip is set to False, dragging the SizingGrip triggers the Resize event. You could follow what happens there to increment or decrement the Form by the same number of pixels"

Peter
0
 
Jacques Bourgeois (James Burger)Commented:
Borderless form were not designed to be resized. I would go with the solution that I gave you with a SizableToolWindow instead of a borderless form.

If you really want to resize a borderless form, you are on your own, I do not have time to look at it into details and provide you with code, I have too much to do these days, but here is what I would try.

You know the original size of the StatusStrip.

In the resize, check the new size of the StatusStrip and compare it to the original. If it is 5 pixels wider, then the SizingGrip was moved 5 pixels to the right and you need to resize the form 5 pixels wider than it is. If the height is 3 pixels less than the original, then you need to reduce the form height by 3 pixels.

I do not know how the StatusStrip will behave when you do that, so you might have to look if it also needs to be resized or if the docking mechanism will automatically take care of it for you.
0
 
peterkiersAuthor Commented:
oke thanks for the info. Peter
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now