Results 1 to 6 of 6
  1. #1
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111

    Resizing Form Stretches Controls

    Reposting issue due to new information discovered leading to title of previous thread being inaccurate to the actual problem. All relevant information from the previous thread is included in this post, but if anyone wants to view the old thread it can be found here: https://www.accessforums.net/showthread.php?t=73585



    I apologize if there are any issues with me reposting this issue or I'm violating some rule by doing so. If that is the case please let me know.

    On to the issue at hand:

    I've recently discovered that some, not all, of my forms are exhibiting a weird behavior that I haven't seen before. If I make the form larger, i.e. maximizing the form / making the form's window wider, some controls will stretch with the form. This isn't consistent with all the controls across the forms that I'm having the issue with. On one form, most if not all of the controls do this, while on another it only happens to one button and a few images. Below are some before/after pictures to help visualize the issue.

    Sample of a form that is not being stretched:



    Click image for larger version. 

Name:	unstretched controls.PNG 
Views:	13 
Size:	34.2 KB 
ID:	35395


    Sample of the same form being stretched:


    Click image for larger version. 

Name:	stretched controls.PNG 
Views:	13 
Size:	74.9 KB 
ID:	35396



    The image and "more" button shown in the sample have been copied over from this form to another and had the same issue prior to any code being written that references them. Also, I've written code to attempt to set and hold the size of these controls, but that had no effect on the stretching.

    I've turned on and off the "FitToScreen" and "Auto Resize" property of the form with no change.

    If I change the "Size Mode" property of the images from "stretch" to "zoom" they no longer stretch, but their position is still altered. Since other controls don't have this property this doesn't create a solution.

    In the previous thread, a user named Minty suggested I check to make sure there are no "placeholders" associated with controls that could be causing strange behavior, but as far as I can tell that doesn't seem to be the case.

    In the past I was looking for a way to make the size of my form objects scale when on larger displays, so I'm assuming this is some unwanted side effect from my attempts at that. However, the only things I remember changing when attempting this are the "FitToScreen" and "Auto Resize" properties, which as mentioned I've already tinkered with and experienced no change.

    Since only some controls on some forms are doing this, I'd also imagine that the specific controls have a property that would be causing this, but couldn't find anything after looking through their properties.

    If any additional information is needed, please let me know. Any help is greatly appreciated.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,931
    you can look at the anchor properties of the controls (format tab in properties)

    Also possible you have set up a layout - under the arrange tab in the ribbon

  3. #3
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    The anchor properties of my controls are set to the default (horizontal set to Left, Vertical set to Top). I've tried setting these properties to all possible combinations with no luck.

    Upon investigating the arrange tab for the form, there are no layouts set as far as I can tell. I know I've never messed with them in the past so I doubt that is the issue, but after investigating the possibility the "Remove Layout" option remained grayed out no matter what controls I selected.

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,931
    Not sure what else it could be. I presume you haven't used any code to adjust controls?

    Always possible the form has become 'confused' if you have made lots of changes. So try compacting and if that fails, recreate the form

  5. #5
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Some forms have code to adjust controls, and some don't.

    Compacting and repairing seems to have stopped the issue for one of the forms, but not all of them. There are still a few forms with the issue. The form that was fixed is probably the most complex of them all. The ones that still have the issue are significantly simpler, i.e. less controls, less changes have been made, less code behind them, etc.

    On one of the forms still experiencing the issue, the only control doing this is a command button. It's not the only command button on the form, but its the only control on the form that's stretching in this way. This button, along with a few other objects, was copied over from the more complex form I mentioned above. At first, all of the copied controls were stretching (this is how I first found out about the issue), but now only that button is. After compacting and repairing fixed the complex form, I tried deleting that button and just made a new one, but the issue is persisting.

  6. #6
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    If you used the wizard to create your form, you will have layout guides. This is one reason why I never use the wizard.
    These appear as faint broken lines around one or more controls and can cause all sorts of issues.
    Make a backup copy of your form just in case.
    Open in design view and look/click around problem areas of your form removing any layout guides as you go.
    Afterwards you may need to resize and/or move some controls.
    Look at anchoring as well if necessary.
    Once fixed, save and, from then on, it should be ok
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 05-07-2018, 04:44 PM
  2. Resizing master form when subform resizes
    By Lukael in forum Programming
    Replies: 9
    Last Post: 12-16-2015, 09:05 AM
  3. Form Resizing Code
    By AccessGeek in forum Forms
    Replies: 1
    Last Post: 04-10-2011, 08:49 PM
  4. Replies: 2
    Last Post: 03-01-2011, 03:06 PM
  5. resizing form based on resolution
    By Jerry8989 in forum Forms
    Replies: 4
    Last Post: 10-09-2009, 08:55 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
  •  
Other Forums: Microsoft Office Forums