473,847 Members | 1,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

i want forms to auto adjust based on resolution of user

62 New Member
I have designed forms in 1024 * 768 resolution.
All forms look good but when user opens database in higher resolution the form shrinks and looks ugly
is ther module using which i can auto adjust forms based on resolution of users system.
Nov 1 '13 #1
9 18155
8,834 Recognized Expert Expert
Rather than rely on Resolution Independant Code for Form Resizing which can be cludgy, and assuming you only have a couple of Forms, you can keep 2 Versions of your Forms.
  1. Check the Users Resolution.
  2. If the Screen resolution is
    Expand|Select|Wrap|Line Numbers
    1. (> 1024 and > 768) 
  3. Load Form A, else Load Form B which was designed in a Lower Resolution.
Nov 1 '13 #2
32,584 Recognized Expert Moderator MVP
The first step is to determine the resolution of the screen, but you don't say if you have that covered yet. Do you? if not, then that is a question in itself.

It's certainly possible, if not necessarily straightforward , to develop code to handle resizing a form.

Personally, I would see providing multiple copies as a kludge rather than handling the resizing in code, but certainly it's a much easier solution to implement, though would obviously make maintenance more involved over time. That's not a lack of respect for ADezii. We don't always agree on everything but there are very few better to help on a question than them.

Only you know what you're really after, so you can choose the approach that best fits your requirements.
Nov 1 '13 #3
5,501 Recognized Expert Moderator Expert
I've ran into this issue many times.

. What I found with scaling using several differnent methods, is that the form then either lacks the space needed for the controls, and/or everything get's so crammed togeither that the form becomes unusable.

. So, I went with the same concept as ADeZii suggested, and as Neopa pointed out, this became a maintenance nightmare in very short order.

. So my solution: I went into the lab, found the smallest, worst case monitor, and built a template form and that is what I use to develop all the applications for the lab.

. Sorry, I tossed the scaling code... it had some API calls that I simply never took the time to learn... This is a VERY OLD thread Form Resizing Code that will give you an example as to what you are up against for resizing... it is NOT for the NOVICE coder!
Nov 4 '13 #4
8,834 Recognized Expert Expert
I feel as though this is the perfect opportunity to demonstrate the concept of Form/Control Resizing. Unfortunately, due to the complexity of accomplishing this, I feel the need to Upload an Attachment. I'll only post the bare essentials here, and leave the rest up to you. Here goes:
  1. When you Open the Database, frmScaleTest will be displayed, consisting of a variety of Control Types.
  2. This Form was redesigned on my PC with the following Parameters:
    1. Horizontal Resolution: 1280
    2. Vertical Resolution: 738
    3. X Logical DPI: 96
    4. Y Logical DPI: 96
  3. Regardless of the End User's resolution, it should display appropriately based on the Parameters that were previously entered at Design Time.
  4. Change the Resolution, Maximize, Minimize, Restore the Form and all Controls as well as the Form itself should Resize.
  5. The Resolutions and DPI Values were obtained by opening frmScreenInfo (Button on frmScaleTest) which will display them along with a Procedure Call on the bottom of the Form.
  6. Substitute this Call for the one in the Form Open() Event, for my Resolution the Call looks like:
    Expand|Select|Wrap|Line Numbers
    1. Call frmResize.SetDesignCoords(1280, 738, 96, 96)
  7. Set the Options on frmScaleTest to Scale Controls, and or Fonts and Columns.
  8. Change the Resolution, Maximize, Minimize, Restore the Form and all Controls as well as the Form itself should Resize.
  9. Look at the Code in the Form's Open() and Load() Events as well as the single Standard Code Module and multiple Class Modules.
  10. After looking over everything, it may become clear as to why I suggested the Option of Multiple Forms.
Attached Files
File Type: zip Resolution.zip (210.2 KB, 2157 views)
Nov 5 '13 #5
547 Contributor
i use this little form to establish and set the screen resolution manually, as i am always worried that different versions of windows/office may affect the result.
Attached Files
File Type: zip screen resolution.zip (57.3 KB, 1496 views)
File Type: zip screen resolution 2003mdb.zip (21.3 KB, 1207 views)
Nov 5 '13 #6
32,584 Recognized Expert Moderator MVP
10. After looking over everything, it may become clear as to why I suggested the option of Multiple Forms.
It may well be (almost certainly is to be fair) the most sensible approach - particularly for a less-experienced user. My comment was mainly directed at the terminology of describing doing it via code as a kludge. It seems clear we have different understandings of what that refers to.

As for the steps involved in resizing a form for different resolutions, that can certainly be extremely complicated, as you indicate. On the other hand, resizing itself can consist of more or fewer changes - depending on exactly what the designer needs in their 'resize'. It could consist of as little as changing the dimensions of the form itself and repositioning the controls across the newly sized form, which would be a job in itself of course, but not too daunting for an experienced coder.

I suspect that if the OP hasn't been frightened off this idea by now, with all the good posts explaining what it can involve, they are either quite competent coders themselves, or too inexperienced even to appreciate what they are being warned about. If in doubt then, go with the multiple versions of the forms as ADezii suggested in post #2. Only attempt to handle this with code if you are confident you have all the bases covered and that you can handle all the coding required - not straightforward in the least.
Nov 6 '13 #7
8,834 Recognized Expert Expert
First of all, it is always a pleasure conversing with you. My concept on Resizing is that if you are going to Resize, 'Resize all the way'. The Attachment in my prior post originates from the Access Developers Handbook. Not only can it Resize Forms and their constituent Controls, but also (optionally) will Resize Sub-Forms and their Controls, Sub-Sub-Forms and their Controls, Scale Fonts, Resize Columns in List and Combo Boxes, etc. All the complexities are encapsulated in the Class Modules and Standard Module. Instantiating the Class and setting a couple of Options in the Open() Event of the Form is all that is needed. The advantage of this approach is that the End User needs to know absolutely nothing about the complex Code but only how to set a few Properties. I guess that I just contradicted myself with my prior statements - you are correct in stating that the
'Multiple Form Approach is kludgy'
. It now becomes a simple matter of To Resize or Not to Resize!
Nov 6 '13 #8
32,584 Recognized Expert Moderator MVP
It now becomes a simple matter of To Resize or Not to Resize!
Indeed my friend - and you give many compelling reasons why this question should never be taken lightly :-)
Nov 7 '13 #9
32,584 Recognized Expert Moderator MVP
As new questions are not allowed in existing threads I've moved this into a new one (Shrinking/Stretching Forms) for you.
Apr 24 '18 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Peter Bassett | last post by:
My app lists jobs for a recruiter. He wants to track members who have replied directly to job postings. So instead of simply making the client's email address an <a href="mailto:...> link, I need to do 2 things: - add a record of their posting to a database table - open the email client to the job Howe do I do this? The first part is easy, but I don't know how to open the email client in an ASP command (I don't really want to auto-sed...
by: houstoncity | last post by:
Hi, I am wondering how to write the code that allows navigating to different pages based on user response. I have one question on the first page that has option (a), (b), (c), and (d) for the answer. If a user chooses different options, i need to direct them to different pages. Your help would be very much appreciated. Thank you very much.
by: Jaco | last post by:
Hey, I can determine the resolution of my screen. But how can I resize all my controls (the whole form) to the specified resolution. Do I have to write for each possible resolution a special function? Is there somebody who can give me a hint or maybe some articles or some keywords to search. What to do with the DPI? I have also to take into consideration that some PC's have increased/decreased there fontsize.
by: Keith A. Rowe | last post by:
I have developed apps on scores of platforms for 25 years. Each of these platforms have supported a "quick, but not so dirty" utility for code table maintenance. For example, I have a States table that contains two columns: StateCode and StateName. I want a simple browser-based tool that will generate the Add, Chg, and Delete routines for me. Would be nice if it can call SQL Server stored procedures since all updates are done thru...
by: scolivas | last post by:
I think this is a me thing. but can't remember how to do it. I have a form that I am using and would like for a txt box to automatically populate based on what is selected in a combo box. here is what I have for form fields: Carton # <auto number> Item Title <txt> Item Accquisition Date <txt (date)> Is item consigned <yes/no>
by: waterox | last post by:
Hi, I would like to build a .flv player which can accommodate 7 different video sizes. This will probably be made using php and xml to dynamically control content. What I would like to know is if and how it is possible to have a holder.swf (just looks for variables to display the flv) that can automatically resize based on the flv dimensions. I dont want any kind of browserscreen resolution resizing of content, just an swf that will...
by: mohaaron | last post by:
I can think of a lot of reasons why this might need to be done but as far as I can tell it's not possible. I've been looking for a way to add HtmlTableRows to a table using a button click for a while and it seems it's not possible because the row that gets added with each click won't get recreated after a post back. After all the reading it seems that any dynamically created controls must be created in the Init event to be recreated after...
by: Gert | last post by:
Inside my workflow "Workflow1" in CodeActivity "startActivity" I do : this.TrackData("Key", "value"); I can see in my SQL SqlPersistence DB in the UserEvent table the tracking value was added. Now I want to search for workflow instances where that value was set from ASP.Net app:
by: SKODA | last post by:
Hi, I am a beginner to MS ACCESS. I have 100+ tickers and each has a table. I would like to retrieve data from a specified table based on user input. My trials: I am unable to create a form that will display user selected tables, like i am asked to specify table from where the data should be displayed when a form is created. would you suggest a VBA code or can it be done with form design? please help me with this issue.
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.