473,797 Members | 3,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

size and position

I have a program I am writing on my desktop computer with a screen
resolution
of 1024 by 768 when I run the program on my laptop with a screen
resolution of 1280 by 768. the size and position of the controls are
changed. I
have used a number of :

TabControl1.Loc ation = New Point(310, 14 + 12)

TabControl1.Siz e = New Size(580, 32)

Panel1.Location = New Point(310, 40 + 16)

Panel1.Size = New Size(580, 432)

Could this be the problem?

If so how can I fix this, is there a need to scale the controls?

If so how is this done?
Nov 21 '05 #1
2 1199
Tom,

It will never look the same.

Have a look at the dock and anchor properties of the form. That will
probably fix your problem the most.

I hope this helps,

Cor
Nov 21 '05 #2
Tom,
In addition to the other comments.

It sounds like you have your desktop running at 96 DPI & your desktop
running at 120 DPI (or visa versa). Correct?

I have one project where I overrode Control.ScaleCo re to scale my Point &
Size values, however my Point & Size values were fields of my type.

You may be able to use Form.AutoScaleB aseSize to scale your inline Point &
Size values.

Using Control.ScaleCo re I have not seen a real difference when running at
either 96 DPI or 120 DPI, although I've seen many statements that auto
scaling doesn't work, at least doesn't work as well as it should. I know
..NET 2.0 has improved support for AutoScale.

http://msdn2.microsoft.com/library/e...us,vs.80).aspx
http://msdn2.microsoft.com/library/h...us,vs.80).aspx
http://msdn2.microsoft.com/library/f...us,vs.80).aspx

The one thing I like about the new properties is that they are at the
container control level & not the Form level, allowing control libraries to
scale better.

I have not done a lot with the above properties yet.

Hope this helps
Jay

"Tom McL." <tb***@cwnet.co m> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
|I have a program I am writing on my desktop computer with a screen
| resolution
| of 1024 by 768 when I run the program on my laptop with a screen
| resolution of 1280 by 768. the size and position of the controls are
| changed. I
| have used a number of :
|
| TabControl1.Loc ation = New Point(310, 14 + 12)
|
| TabControl1.Siz e = New Size(580, 32)
|
| Panel1.Location = New Point(310, 40 + 16)
|
| Panel1.Size = New Size(580, 432)
|
| Could this be the problem?
|
| If so how can I fix this, is there a need to scale the controls?
|
| If so how is this done?
|
|
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
4556
by: wired | last post by:
Hi, I've just taught myself C++, so I haven't learnt much about style or the like from any single source, and I'm quite styleless as a result. But at the same time, I really want nice code and I go to great lengths to restructure my code just to look concise and make it more manageable. When I say this, I'm also referring to the way I write my functions. It seems to me sometimes that I shouldn't have many void functions accepting...
12
10955
by: Brett L. Moore | last post by:
Hi, I have had trouble determining whether the STL list.size() operation is O(1) or O(n). I know the list is a doubly-linked list, so if the size() operation begins at the head, then counts to the end - obviously its O(n). However, keeping track of inserts and deletes isn't that tough, so its conceivable (to me!) that size() could be O(1). For my application, the lists can be quite long (millions of elements), so the answer greatly...
2
1413
by: Billy | last post by:
Hi, This is in connection to the tread: Re: changing browser text settings?? I am wondering if there is a way to retrieve the browsers text size (not change! ;-) ) so that I can dynamically resize the size and position of the layers to accomodate larger than normal text-size settings. I really hope there is because it would mean not re-writing the whole page (which I'm not sure how to go about). the page is here:
2
1603
by: grayFalcon | last post by:
Hello! I've got a small problem here. I'm trying to write some code that would generate a drop-down menue for me, where I'd just need to enter the menu- and submenu items into an array. The items are to be displayed as text. Now, I want to have the layers with the submenues to appear more or less under the appropriate main menu items. For this I need to be able to calculate how many pixels a given text uses up on the screen of the user....
3
9671
by: spencer | last post by:
Hello, I have an index page with an autoscroller writen with CSS. The problem is the scrolling content(text and inages)'s position is correct but will off position when the broswer(IE) window size was changed. How can I make the scrolling content "stick" the position with respect to the scrollowing box? Your advise is appreciated. Spencer
5
2550
by: Francois Soucy | last post by:
Hi all! I've created a personal control. This control is mainly a panel with some other stuff in. I want to know if it's possible to know the size of the container of this control? I mean that my control can be put on a form or a panel. I want to know the size of the container without knowing what will be exactly. It' possible? Thank a lot --
14
3434
by: Galen Somerville | last post by:
My current screen resolution is set to 1024 x 768. My form size always comes up as 1032 x 748. I have tried the help sample ' Retrieve the working rectangle from the Screen class ' using the PrimaryScreen and the WorkingArea properties. Dim workingRectangle As System.Drawing.Rectangle = _ Screen.PrimaryScreen.WorkingArea ' Set the size of the form slightly less than size of
4
6179
by: BrianKE | last post by:
I am attempting to create an app that will run "on top" of another app. My app will create a transparent window over the other app for the purpose of displaying information. I am able to create my transparent app but cannot get the size and position of the other app. I can get the handle of the other app using the DllImport("user32")...FindWindow method. However, when I try to get this size/position of this other window using...
17
2655
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I find the size of a browser window? ----------------------------------------------------------------------- Where supported in NN: (>NN4.0) var winWidth = window.innerWidth; var winHeight = window.innerHeight; Where supported in IE: (>IE4.0)
20
2500
by: Ashit Vora | last post by:
Hi, I 'm new to C programming and 'm stuck somewhere. I want to find the size of a file. I couldn't find a proper way of doing it. What I was planning to do is... Open the requested file, default position is 1st byte. Now I use fseek() and move it till the send of the file. Than I use ftell() to get the current position in the file.
0
10469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10209
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,...
0
10023
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 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...
0
9066
agi2029
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...
1
7560
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6803
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();...
0
5459
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...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2934
bsmnconsultancy
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.