CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15

Threaded View

  1. #6
    Join Date
    Sep 2009
    Posts
    62

    Re: Resizing question.

    Here's an update with a working solution to get around the form design problem: I can't resize a form without anchored controls also resizing.

    In the absence of solutions here I posted the same question on the newsgroup "microsoft.public.dotnet.languages.csharp". Someone came up with a solution.

    Close Visual C# and then open the xxx.Designer.cs file, which corresponds to the form, in a text editor. [Edit. Visual C# does not need to be closed, xxx.Designer.cs file can be edited manually in Visual C# and the form size will change when you switch back to the designer.]

    I was advised to manually change the "this.Size = new Size(xxx, yyy);" line to a new size. In fact there was no such line. However instead I changed the ClientSize line.

    "this.ClientSize = new System.Drawing.Size(xxx, yyy);"

    It worked - resizing the form but without the anchored controls also resizing. Then I simply highlighted all the groupboxes and controls, moved them down a bit and added the menu. Of course I had to close and reopen Visual C# 2008 Express several times while I fine tuned the exact amount to make the form bigger by - but it has worked perfectly.

    Hope this helps anyone with the same problem. I think the options pertaining to the Windows Form Designer should include an option to disable anchoring when in design mode, so that it can be ticked on and off while a user is designing their form. Maybe in the next version.

    PS. Anyone know of any problems that might occur from reiszing a form like this?

    Cheers.
    Last edited by mattst; October 21st, 2009 at 06:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured