Published project not working on all computers? - vb.net

I have a working vb.net project which runs successfully on my host computer through the console. I've published it, installed it on other computers, and run it successfully on those machines. I have installed xampp which is necessary for the php to run behind the scenes as well, and again, everything runs perfectly.
However, this morning, I went to install it on another computer and something weird occurred. One of the labels on the window, overlapped into a text field. This sounds somewhat harmless, but the result was that the user could not use the text field, and so the app will not work.
Basically my question then is, is there some way to limit the formatting so that it will work on all computers? (I find this odd to ask, since the questionable computer is a windows 64 bit operating system as is the computer's I've installed on and the computer I'm currently on)

It sounds like the DPI settings are causing your issue. You can verify this by changing the DPI settings back to 100%, restart the computer and see if it makes any difference. See this Link on how you can change your DPI settings.
I can't give you a straight up answer on how you can solve this issue that you are experiencing. But I am going to give you a lead to how you can solve it.
See the links below for two other threads on the issue:
Creating a DPI-Aware Application
How do I detect if the user's font (DPI)...
Some more information on the matter:
Creating an application that will scale correctly on other computers will depend if you have written the application in 100% DPI yourself. If you have not, then you might experience issues downscaling or upscaling the application size to fit other DPI settings.
You want the application to scale depending on user settings. You can use the following code to do so:
Public Sub New()
InitializeComponent()
Me.AutoScaleMode = AutoScaleMode.Dpi
Me.AutoSize = True
End Sub
Keep in mind, this will scale the current form, you will have to do the same for all other forms that you have in your application. See bullet-point link 2 for more information on this.
If you have used containers such as Panel, TableLayoutPanel, etc. whilst creating your form, you will have a better time making the form fit the other DPI settings. (I know this from personal experience with application scaling.)

Related

How to fix blurry VS2019

I ran into an issue where my second monitor with decent resolution, was showing a poorly rendered VS2019.
Disclaimer: If somebody would port the features I need in VS2019 to VSCode that'd be great.
Anyway, here is a pic that sums up my issue and since I had to comb through the annoyingly fixed-but-not-fixed, yet locked, tickets on MS to find clues to my answer I'm sharing here.
Here is my secondary, 27" monitor, with poor rendering. This happens to be the ONLY program that does this... VSCode looks great and is readable, Outlook, Gimp, they all look fine. Only VS2019 is giving my eyes pain.
Main/Built-in Monitor looks just fine though. I'd prefer to work with more screen space though.
In VS2019 GOTO: Tools > Options >> Environment > General, and look for "Optimize rendering..." Note: This screenshot is from after I'd found and applied the the fix.
It will be grayed-out and unselected if requirements are not met by your system, along with a message, "Requires NET 4.8 and Windows 10 minimum build 1803". I then mistakenly installed NET 4.8, and nothing changed (and the checkbox was still locked indicating requirements were not met).
More searching lead me to the 4.8 Dev Pack. Here is a link to it:
NET 4.8 Developer Pack
Finally, after another reboot, I opened up VS2019 and the rendering looks something like modern... and the checkbox automatically checked itself.
For me the accepted answer didn't change anythig, turns out it was caused by scaling on Windows (on main monitor it was set to 125%), after changing it to 100% everything looks normal
For me, I just move the VS window to the blurry monitor. Close VS. Open VS again and all looks good.

Scaling issue while running program (visual studio 2017)

Its probably best to mention first this issue is on a school system.
The issues is that when i start my program, the first form is fine but the second form scales very strangely so everything is small and blurry.
When I open my project I get a message saying my main display is set to 200% so I click the link to restart with 100% but the problem persists,
this issue suddenly appeared without me changing anything which leads me to believe it's an issue with the school system but I'm unsure and would be welcome to any suggestions.

How do I go about designing a form for 960x540 resolution?

I have an application that I am in the middle of development for, and I never took into account the fact that some users may be running their machines at a lower resolution than mine. I can't change the resolution on my machine as it only puts out 1680x1050. Since I've ever only developed applications for myself, I've never thought about the whole resolution aspect of development, so I wouldn't even know where to begin. Unfortunately, I am tied down to VS2005 with the .NET 2.0 framework and MUST use it. Any help towards how to go about starting this would be great, thanks!
960x540 is a fairly ridiculously old resolution to be supporting, but you can achieve what I think you're wanting simply enough.
Go to your designer, click on the form. In the Properties pane, change the Size option to whatever minimum resolution you're trying to support, e.g.: 950, 530
I would recommend, however, that you simply use the above direction for design purposes, so you don't create controls that are off the screen or require scrollbars. What you should also do is set the WindowState to Maximized, what way it will always just fill their screen. In most cases, I believe this is a wise route as most end-users barely know how to browse the internet.

How to force an application to use DPI virtualization on Windows 7/8

Is there a way to force an application to use DPI virtualization in Windows 8.1? I have an application that wrongly declares to be DPI aware, and displays too small on my high DPI screen (don't have the source). It would be sufficient if it was scaled up 2x by Windows.
I tried editing the .exe's manifest, and setting <dpiAware>false</dpiAware>, but it had no effect. (It might have made the few pieces of the application that used a larger (appropriate) font use a small font (in pixels), like I'd expect for DPI virtualization, I'm not entirely sure... but it certainly did not activate the DWM scaling.)
What can I do? I read that other settings in the manifest may affect DPI virtualization other than dpiAware, is this true? The app might be setting DPI awareness at runtime via API, how can I find out if this is the case?
(Posting this here and not on superuser because there is no user-facing setting for this, and I expect the answer to be something along the lines of "edit the manifest such-and-such" or "inject a DLL/attach a debugger and do this". Also the fact that I don't have the source is secondary, I also have in-house apps where I have the source and would like to fix, and I'm asking for the more general solution that would fix both cases. I hope that's OK.)
I just released a DLL that hooks and redirects calls to SetProcessDPIAware. For applications that disable DPI scaling through code, this is a fast and easy fix (compared to binary patching). Just load the offending application with a tool like CFF Explorer and add this DLL to the import table. (Alternatively, it could be injected dynamically at application launch.)
Note that the current release only hooks SetProcessDPIAware and leaves SetProcessDPIAwareness untouched. If that's an issue, feel free to ping me and I'll hook both.
DPIMangler: Blog post, source code.

Visual Basic .Net software behaves differently from machine to machine

I've inherited a lot of custom made software for an office, and, while managing it, I've found it performs differently from machine to machine.
I mean, some controls get painted in weird ways in some machines but well in another, or just work differently, like in some machines clicking something selects it, and in the next machine clicking the same thing makes it editable.
I suspect, of course, of the myriad of DLL the software loads.
Why does it happen? Is there any way of avoiding it?
Edit:
All the machines are Windows XP SP3, Internet Explorer 8
"get paint in weird ways" to me means things like a control being painted 300 or 400 pixels bigger in a machine than in the others (overlapping part of the GUI).
I would suspect that some COM components are the issue (COMCTL32 would be my first guess), and that it isn't really a VB.NET problem. Versioning in the .NET world has been made so that the typical DLL hell issues shouldn't happen as they did before, but there are always some relics around...
Without more info I doubt that there will be a final answer to your question. You may want to start your troubleshooting by comparing Windows, Service Packs and IE versions.
Step 1. Ensure all machines have the exact same updates applied. This goes beyond the service pack. Run Windows Update on each machine and apply everything you can. I suspect you have radically different patch levels across the board.
Step 2. Ensure all machines have the native screen resolution set. This is more important for flat panels than the ancient CRT monitors.
Step 3. Look at the video drivers. Make sure you have the latest ones for those machines.
Step 4. Make sure the exact same version of your app really is deployed across all of the machines. If there are external dependencies, verify those are the same as well.