Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winforms - ResizeEnd not being called on Form resize

Tags:

c#

winforms

I want to run some code after my form is resized. However, the following code never runs when I resize. I'm sure it is something simple I looked over(I am brand new to C# and programming in general). Thanks.

    private void CalibrationForm_ResizeEnd(object sender, EventArgs e)
    {
        MessageBox.Show("You are in the Form.ResizeEnd event.");
    }
like image 761
Thad Blankenship Avatar asked Oct 31 '11 20:10

Thad Blankenship


People also ask

Is it possible to resize a control within the form design window?

You can resize individual controls, and you can resize multiple controls of the same or different kind, such as Button and GroupBox controls.

How do I make Winforms resizable?

To make a control resize with the form, set the Anchor to all four sides, or set Dock to Fill . It's fairly intuitive once you start using it. For example, if you have OK/Cancel buttons in the lower right of your dialog, set the Anchor property to Bottom and Right to have them drag properly on the form.

How do I make winform not resizable?

Resizing of the form can be disabled by setting the FormBorderStyle property of the form to `FixedDialog`, `FixedSingle`, or `Fixed3D`.

How do I fit windows form to any resolution?

simply set Autoscroll = true for ur windows form.. (its not good solution but helpful).. Save this answer.


1 Answers

You seems not hooking the event, even hook it in the properties (right click form then properties and choose the event as in the picture)

enter image description here

or hook the event in the constructor as follows:

YourForm.ResizedEnd +=new EventHandler(CalibrationForm_Resize);
like image 195
Mohamed Abed Avatar answered Nov 10 '22 07:11

Mohamed Abed