473,408 Members | 1,762 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,408 software developers and data experts.

struggling to get correct runtime/designtime dpi values

I'm struggling to get proper runtime and designtime dpi values.

In the forms .designer.vb I've added the following code after
InitializeComponent()

Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0F, 96.0F)
Me.AutoScaleMode = Windows.Forms.AutoScaleMode.Dpi

And in my code behind the form, I've added,

Dim RunDPIvalue As SizeF = Me.CurrentAutoScaleDimensions
Dim DesignDPIValue As SizeF = Me.AutoScaleDimensions
Dim autoscalefactorvalue_height As Single =
Me.AutoScaleFactor.Height
Dim autoscalefactorvalue_width As Single =
Me.AutoScaleFactor.Width

But the DPI values for run (current) and design (auto) are both being
returned as 96.0. And the AutoScaleFactors are both returned as 1. I would
have expected 120 and 1.25 respectively.

I'm running vb2005, W2k 2000 SP4, Net framework 2.0. Screen resolution is
set at 96dpi (small fonts). And the form font is set to Microsoft Sans
Serif size 10.

Thanks

Steve

Note: I'm using this to handle resizing a word automation window.- not to
modify the form sizing.
Dec 17 '06 #1
0 1025

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

Similar topics

0
by: Rahail | last post by:
Hello, I have a question, can someone help me please? What are the differences between a runtime and a designtime component? Is runtime component only good for running with the .exe and not...
4
by: Angus Comber | last post by:
Hello I have received a lot of help on my little project here. Many thanks. I have a struct with a string and a long member. I have worked out how to qsort the struct on both members. I can...
0
by: Daniel Weinand | last post by:
hi, i'd like to develop an "formular generator". target is that the user can drag and drop different controls to a form. the behavior of this tool should be quite similiar to VS during designtime....
3
by: | last post by:
Hi,all I want to change Control's size&location in runtime ,(C#) but i dont know how to do! :(so, can you provide me with document about this. my email: zhonghua@rinpak.com.cn ...
0
by: Michael | last post by:
Hi, I found a wierd problem in DataGrid. If I set DataGrid's DataSource to empDataSet1 at designtime, then I can never change its DataSource at runtime, e.g., in the Button1_Click event...
7
by: Varangian | last post by:
Hello is creating controls at runtime the same as designtime ? will a page be faster if controls are created at designtime rather than at runtime ? If so why ? thanks :)
1
by: A.Neves | last post by:
Hi, I'd like to have my ConnectionString retrieved from the same place in RunTime or in DesignTime (in VS2005). Is It possible? How? Any help would be very much appreciated. Thanks.
2
by: Martin Arvidsson | last post by:
Hi! I have developed a component that creates a lookup for selecting values. At designtime i want to display the windows as well but with certain criterias. is there a property or something to...
2
by: Johnny Jörgensen | last post by:
I would like to be able to tell whether my component code is executed when I instanciate a control in runtime or in designtime. Can anybody give me a clua as to how you can do that? Cheers,...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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,...
0
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...

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.