Why do a .net form and controls not size properly on a given user's machine? - vb.net

We received a large net desktop application from another agency to implement at our agency. It's messy, but works. It uses a midi form with forms opening inside that, and panels. We compiled and deployed in Visual Studio 2015. It's VB.
All users have Windows 7 64 Pro. For one user, when forms open, the lower portion is cut off. If restored (un maximized), the form shrinks to a tiny window in the upper left of the midi window. If borders are dragged the form will expand, but only a small portion of the form at the upper left will contain anything, as if inside a shrunken panel with scroll bars.
I changed the application so forms have a minimum size that should prevent them from shrinking down, but that doesn't work on her machine. I also changed a couple of panels to "fill" similar to adjacent panels. On other machines the application works excellent, even if display is changed to larger 150%. On the problem machine, the application only works if the display is set to smaller 100% and will not work on medium or larger. The user chooses to have larger.
I can place code on resize events and try to force everything to display correctly, but should not have to do that. The application works correctly everywhere else. Something is different about the problem machine where window metrics are not being computed properly or something similar. All machines are made from the same image and have the same drivers. I cannot see any additional software installed.
I would like to know if anyone else has seen this issue and how it was resolved.

Related

Why is my Visual Studio (VB.NET) layout different in Design View vs. at run-time on my home computer, but identical on my work computer?

I've been developing a program with Windows Forms on my work computer in VB.NET using Visual Studio 2013. When I run it on my work computer, the forms at run-time look identical to the forms in design view - the same overall size, the same layout, etc. Here is what it looks like on my work computer - AND when I access my work computer over remote desktop from my home computer.
However, on my home computer, it looks different in design view than at run-time. The form in design view is smaller and labels are misaligned.
Both computers are running Visual Studio 2013 with the same settings. I'm working on a larger monitor at home, but the fact that things look right when I access my work computer over Remote Desktop makes me think it's not my monitor.
My work computer is Windows 7 while my work computer is Windows 8.1.
Things I've tried:
Anchoring/docking the labels, but the layout ends up looking wrong
Changing the AutoScaleMode to DPI instead of Font, but that only changes the appearance at runtime, not in design view, and it still doesn't match design view.
Any ideas?
I figured it out! It was a setting in Windows on my home computer. (Still unclear why it looked right via Remote Desktop, but maybe it uses the remote computer's settings instead of the local one's).
The solution was:
Right click, choose "Screen Resolution"
Click "Make text and other items larger or smaller"
Check "Let me choose one scaling level for all my displays" and set size to "smaller - 100%"
For some reason, on my home computer the size was set to 125%.
After searching for a solution online this worked for me:
this.AutoSize = false;<br>
this.AutoScaleMode = AutoScaleMode.Font;
I put this code on form load and the display remained the same.

VB.net Forms UI display issue in some laptop

I am new in VB application and can't figure out what's wrong with my app. There is a form which has a couple of labels and text fields. When I run the app on my and few other folks's machines it displays fine with proper alignment and font. However, for some people application form UI is broken unaligned text and buttons. Any one have any idea what's wrong with my application?
Okay, After some research, we found that the display settings for those users were set to 125% and because of that there were UI issues. I changed the display settings back to 100% and Booom it works just fine. Thank you all for you help.
This problem can occur for a number of reasons.
In my experience, however, it is commonly caused by setting the Font on controls, only to discover that certain users do not have that font installed on their machines. As a result, Windows forms selects a font for you that it believes is a close approximation--usually with horrifying results. Widths don't match, and controls end up horribly aligned.
Make sure you are not using a font that is not built into the OS. If you are designing the application in Windows 7, for example, and shipping to multiple platforms (Windows 2000, Windows XP (the horror!), and Windows 8), you may find that font availability is drastically different on these various platforms.
Though not aesthetically pleasing, stick with the lowest common denominator in these cases. If you can, use Segoe UI, which should be present on all these platforms (except XP) and which Microsoft now recommends.

vb.net application Cancel button runs into the edge of the form in Windows 7

I have an application written in vb.net which works fine in both Windows XP, Vista and 7. However, in Windows Vista and 7, the button layout (specifically the Exit/Cancel button at the bottom right) of all the forms acts weird, as the Exit/Cancel button runs all the way touching the edge/boundary of the form as shown in the pic below.
This does not happen in Windows XP. Nor does it happen on disabling the Visual Styles in Windows 7, as shown below
What can be the cause for this issue and is there any way to solve this, so that it looks good for both XP and Windows 7?
EDIT: I'm posting this on behalf of a friend - Abhijit (https://stackoverflow.com/users/2642426/abhijit-hota) - who wanted to post this himself but had less than 10 reputation. Apparantly you need to have at least 10 reputation to post a question with an image.
One way to fix it is the place the buttons in a TableLayoutPanel. Then you can
Move it a bit further from the edge
Or leave an extra column on the right as a margin or gutter
Or anchor it in a way (left maybe) to prevent it
Another possible cause is that the controls are not using the Anchor property and he has tried to neatly line them up with something as an absolute position (which Visual Stlyes messes up as relative sizes and text extent changes). Any given user may or may not be using Styles Anchors so a layout panel works well to neaten things up.

Washed Out Controls with VB.NET

I recently upgraded my system to Windows 7 Professional. Furthermore, I recently upgraded from VB6 to VB.NET and I've been working with forms and control under the new interface. Controls such as text boxes and tab controls are washed out and very difficult to see.
In my attempt to remedy the situation, I personalized my display by unchecking the box under "Windows Color" entitled "Enable transparency" and adjusting the Color Intensity slider all the way to the right. But no matter what I try to do, I still get washed-out form colors.
Is there a setting for adjusting the default form colors? What am I missing?
It seems to me that you have a couple of choices, all of which you probably won't like.
Change your Textbox BorderStyle from Fixed3D to FixedSingle, this will give you a more pronounced border around the textboxes (no such property on comboboxes though). This will also make your textboxes look a lot more 'flat', which you may not want.
Change either the background of your form or the background of your controls, thereby providing a better contrast between the two. Even slight variations on the same color would help.
Purchase (or make your own) custom controls that have built-in style changing abilities. I use the Telerik controls sometimes. They have the ability to let you change the UI Element's styles, including all kinds of colors and different borders and such. The issue with this option is a lot of these custom controls are overly expensive, although you can find decent ones for fairly cheap sometimes (I found a control set once that was pretty nice for $19).
Whatever you decide to do, you have to remember that your form will look different to users that are using different operating systems than what you're developing on. You noticed a big change when you went from (I'm assuming) Windows XP to Windows 7 right? You have to remember to test your application on all operating systems that your application will be expected to run on. You could design it beautifully on Windows 7 and it may look horrible on XP. You may be able to ignore OSs that are older than XP, but for the time being almost 50% of users still use XP (last I checked).
BTW, there is no setting for adjusting the default form colors... this just happens to be how forms look on Windows 7. I found it an adjustment when I went from XP to Win7, but you get used to it. I very rarely make the background of my controls the same color as the background of my form just because of this... oh, and don't go changing your display, you want to see what your users are going to see - otherwise you'll end up with something that only looks good on your computer. :)

VB.Net - Buttons missing on one client

We're facing a strange problem here. One of our users cannot see two buttons on a form, that everybody else can see. I'm not sure if the buttons are not there or the window is smaller than it should be. The size of this window is fixed, so it cannot be adjusted manually. (it is like a pop-up window informt of the main window)
Our application is used by employees of our company all over the world. So they all have windows xp in different languages and their regional settings differ. But I can't see how that would make a difference.
Does anyone have an idea?
A reason for this might be that the user changed the DPI setting on its machine. Typically you would change that in the control panel, in the Display settings you can choose to have a font size of 100%, 125% and 150%. This affects the DPI and might push winforms controls further down the form, making them "invisible" (below the bottom boundary of the form).
Here are instructions on how to change DPI settings on Windows XP.
If this is the cause for your problem, you have to make sure your forms scale properly. Look at the MSDN documentation for automatic scaling.