Best fit for Form (1 Viewer)

ryetee

Registered User.
Local time
Today, 15:36
Joined
Jul 30, 2013
Messages
952
I am developing a database for a user who previously used an off the shelf piece of software which didn't entirely fit with his method of working. He's happy with what I am doing but he has been spoilt rotten by the nice to haves he currently experiences with his off the shelf package. One is getting a 'best fit' for his forms.
Currently the piece of software fits the form on to one screen (widthways if that's a word). It looks pretty sophisticated in that it dynamically resizes each column width as you scroll up and down. Very rarely do you have to scroll left to right and back. The design I have fits my screen but if there are any long customer names they get truncated. Conversely if displaying a screen of very short customer names there's a lot of white space.
I've read something about setting the FitToScreen property but I guess that's for size of monitor. I've tried me.controname.columnwidth = -2 but presumably that doesn't work on a continuous form. I've looked at anchoring stretching to fit can grow can shrink but can't find any examples of it working and I've tried in vain myself.
Is it possible?
 

Ranman256

Well-known member
Local time
Today, 11:36
Joined
Apr 9, 2015
Messages
4,339
every col is different width and different text IN the column.
you can stretch the column to where you want, click SAVE and it should stay.

column widths cannot be negative. 0 = hidden.
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 11:36
Joined
Apr 27, 2015
Messages
6,286
@Isladogs has a utility that automatically adjusts your application to whatever your screen resolution is. Not sure if that will fix your problem but it might.

I have tried to find in because I have plagiarized it but I cant seem to locate it on my home PC. Hopefully he will see this and chime in. If not you may try to PM him...
 

ryetee

Registered User.
Local time
Today, 15:36
Joined
Jul 30, 2013
Messages
952
every col is different width and different text IN the column.
you can stretch the column to where you want, click SAVE and it should stay.

column widths cannot be negative. 0 = hidden.

i'm using a continuous form so i can set the optimum widths but i want to do it dynamically. the customer name can be as little as 5 characters and as much as 40.
 

ryetee

Registered User.
Local time
Today, 15:36
Joined
Jul 30, 2013
Messages
952
@Isladogs has a utility that automatically adjusts your application to whatever your screen resolution is. Not sure if that will fix your problem but it might.

I have tried to find in because I have plagiarized it but I cant seem to locate it on my home PC. Hopefully he will see this and chime in. If not you may try to PM him...

I'm not after changing the form to fit the screen resolution I want to be able to change the width of certain controls as they can contain different amunt of text. e.g. customer could be abcde or abcdefghijklmnetcetcetcetc. If I set the control for the widest I'm using up to much of the form.
 

isladogs

MVP / VIP
Local time
Today, 15:36
Joined
Jan 14, 2017
Messages
18,186
This is a question that comes up periodically
In my experience, resizing a control when the text contains more characters that can be displayed is problematic. Its difficult to get the rest of the form controls to adjust properly
Similarly, reducing the font size in the same situation looks a mess in my view

Also if you have a continuous form, all controls are affected by either method

Better IMO is to use a 'zoom box' to display all the text. You can use the built in version using Shift+F2 or create your own.
For example, see the attached where the customised zoom box position is just below the selected control (as required by another forum member)

For anyone else who would like to see my form resizing code, its included in almost all of my example apps. For example see: https://www.access-programmers.co.uk/forums/showthread.php?t=293584
 

Attachments

  • MoveForm&Control_v3.zip
    52.9 KB · Views: 89

ryetee

Registered User.
Local time
Today, 15:36
Joined
Jul 30, 2013
Messages
952
This is a question that comes up periodically
In my experience, resizing a control when the text contains more characters that can be displayed is problematic. Its difficult to get the rest of the form controls to adjust properly
Similarly, reducing the font size in the same situation looks a mess in my view

Also if you have a continuous form, all controls are affected by either method

Better IMO is to use a 'zoom box' to display all the text. You can use the built in version using Shift+F2 or create your own.
For example, see the attached where the customised zoom box position is just below the selected control (as required by another forum member)

For anyone else who would like to see my form resizing code, its included in almost all of my example apps. For example see: https://www.access-programmers.co.uk/forums/showthread.php?t=293584

Thanks, I'll take a look. I know it's a pain as I've tried a few years ago and gave up. The user's current software has a real whizzy set up. As you scroll all controls change depending on their content. Looks really flash.
 

Users who are viewing this thread

Top Bottom