473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to center content of a form on screen? Auto Center does not work.

2
I have searched several postings with similar questions but have not found a response that works. You would think that it would be fairly simple to center the content of a form on the screen (regardless of size and resolution) but that does not seem to be the case. Auto Center set to Yes does not work. I am running XP and Access 2007. Any help would be most appreciated. Thanks!
Jul 22 '10 #1
3 13390
NeoPa
32,556 Expert Mod 16PB
Are you centering within the application (Access) or the screen?
  1. If the former, then I've only noticed problems when switching from Design View, so if this is what you're noticing try closing the form completely then opening it again from scratch. It should work.
  2. If the latter, then to expect this to be straightforward shows a certain lack of understanding as to what's what. A form is an object that is within the application. Positioning of this object is always relative to the application window, indeed any part of the object that protrudes beyond the application window is clipped.

    With that in mind (obviously it cannot be centred at all in the screen unless that part of the screen is already taken up by the application window) it is possible to centre the form within the screen. It would involve getting the screen co-ordinates of the application window and doing some math to determine where it should be placed within that to have the effect of being centred in the screen. The maths are pretty straightforward, but I'm afraid I don't know the system function call required to find the co-ordinates of the application window. That information's out there though, if you look.

Welcome to Bytes!
Jul 22 '10 #2
Dfresh
2
I should probably provide more detail. I am using the tabbed documents option within the Access application. When I have a form that does not stretch across the entire viewable area of the screen/application (sorry if I am not using terms correctly), I would like for it to be centered within the tabbed form (horizontally not vertically). Even with Auto Center set to yes, it always appears left alligned with a great deal of empty white space to the right of the form. Are there other settings I am missing to get the Auto Center to work?
Thanks
Jul 22 '10 #3
NeoPa
32,556 Expert Mod 16PB
I'm not very familiar with the AutoCentre property, but I think it works only for freestanding forms. When a form is used within another form or report (in a SubForm control) then the positionning is specified explicitly in the design.

You can either design the form (SubForm etc) to position it where you want it, or you can set the left position in code after the main form has been loaded.
Jul 22 '10 #4

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

Similar topics

7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
2
by: joey.powell | last post by:
Make Firefox Center Content in a div Or td Tag By Using CSS? Does anyone know how to do this. IE works great with text-align:center; but Firefox just always left-aligns...
3
by: Benny | last post by:
Hello Experts, Currently I am working on a windows application using vs.net 2002. Assume I have two forms, form A and B, where form A is the main form. In form A, I have a button which will...
1
by: Lee99 | last post by:
Hey guys, Love the forum. Been browsing a lot, now time for my first post :-) I'm wondering how to set a <div> tag to be center aligned to the screen, both horizontally and vertically... so...
4
by: x taol | last post by:
i want to display the image in center of form wherever the image located in the form using vba or and so on. *** Sent via Developersdex http://www.developersdex.com ***
10
by: BNicholeN | last post by:
Hi I need to know how to get a form to auto populate, i.e. When I pick a city from Center Location, I would like the Operations Manger and SVP to populate once a selection is chosen. A related...
0
by: jayasabari | last post by:
Hai, I am reading the content form the msword file and displaying(writing) in aspx page(i.e., .net page). The content is displaying but some symbole is displaying My codding: ...
1
by: Tbone | last post by:
I am designing my web forms around a 640x480 display resolution. How can I center my form horizontally so it is not crammed into the left corner on larger displays?
5
by: Nathan Sokalski | last post by:
I have css that would normally be placed in style tags in the header of the Master page that I want to add programmatically for a specific Web Content Form (the *.aspx page). How do I do this for a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
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...

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.