How to automatically change back Location, Size and Index ID in Form.Design

Simon 366 Reputation points
2023-07-17T15:45:30.1666667+00:00

In all the panels in my form, I changed the property of AutoResize =True, thinking that that is how the user will be able to resize the form when running the application according to the user's size of his device.

I realized that that was not the appropriate code, because the AutoResize property is blocking me from resizing the panel as needed. It makes the panel according to the size of the contents within the panel. So when I added code that the form should resize the fields and panels according to the size of the device, it didn't work.

When I tried inserting the code to resize the form in a different project, it worked beautifully. That's when I realized that the codes below indicating the Location, Size and Index Id were removed from all the Forms Fields and Panels, and were replaced with the code below.

     Me.Loan.Location = New System.Drawing.Point(7, 43)
        Me.Loan.Name = "Panel9"
        Me.Loan.Size = New System.Drawing.Size(1261, 745)
        Me.Loan.TabIndex = 9

and instead of the codes above, it inserted the following code:
 resources.ApplyResources(Me.Loan, "Loan")

How can I automatically replace the Apply.Resources code with the Location, Size and Index Id throughout my project, without having to manually replace it.

Thank you in advance for your help.
Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,922 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,424 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.