473,758 Members | 5,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
InitializeCompo nent()

Me.AutoScaleDim ensions = New System.Drawing. SizeF(96.0F, 96.0F)
Me.AutoScaleMod e = Windows.Forms.A utoScaleMode.Dp i

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

Dim RunDPIvalue As SizeF = Me.CurrentAutoS caleDimensions
Dim DesignDPIValue As SizeF = Me.AutoScaleDim ensions
Dim autoscalefactor value_height As Single =
Me.AutoScaleFac tor.Height
Dim autoscalefactor value_width As Single =
Me.AutoScaleFac tor.Width

But the DPI values for run (current) and design (auto) are both being
returned as 96.0. And the AutoScaleFactor s 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 1043

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

Similar topics

0
1797
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 during development environment using Visual Basic 6 (For example, an error pops out saying License is not found - I am using 3rd party components.)?
4
5602
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 do a bsearch on the long member (nKey) but I am struggling to do a search using the string member. The code I am running appears below. It doesn't crash or anything. It is just that when I do the last bsearch using "192.168.1.3" I SHOULD find...
0
975
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. that means, adding controls, the ability to change size and position of the controls. for now only text relevant controls are needed. i have no idea how to do that. can the design time behavior of controls be used during runtime?
3
11354
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 zhonghua_1999@163.com thank you in advance.
0
1118
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 procedure: DataGrid1.DataSource = dataView1; DataGrid1.DataBind(); But if I clear DataGrid's DataSource property at designtime,
7
2225
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
1568
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
1499
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 look at that tells mee if its designtime or runtime? Regards Martin
2
1710
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, Johnny J.
0
10072
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
9885
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
8737
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
7286
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
6562
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
5172
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...
1
3829
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
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
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.