Windows Form renders unevenly in designer - vb.net

I have a Windows Form that, for some reason, has changed in looks. Even though no UI changes have been made, certain controls look smaller and some controls, such as the Text in a GroupBox wraps when the app is run. However, when I run the app on other workstations, it looks fine. I don't understand what would cause this unless there were Microsoft updates. Any ideas?
I have attached 2 screenshots, one in the designer mode and the other in execution mode.
Execution Mode
Thanks,

Looks like you didn't design your app with a DPI aware state. Try redesigning it in UWP instead of WFP as UWP is automatically DPI aware.
Also the button that disappears on the right side that says finish, try making sure the Button.visible property is not set to false.

Related

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

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.

Running winforms app from debugger disables alt-tab switching to form

I have a Winforms app with a main form where a multiline text box is updated during a long running process.
I would like to be able to use the ALT-TAB facility of Windows to switch away from the Visual Studio 2012 IDE to watch the form being updated as the app runs.
Is there some option that controls this? If I have other apps running such as Notepad I can toggle away from the IDE but navigating in this way to the running Winforms app seems to be disabled.
Last time I debugged an app like this I recall this sort of switching worked but sometimes there was a lag in the rendering of the screen.
The winforms app is not multithreaded.
Any ideas?
The winforms app is not multithreaded.
Which means you're doing all your lengthy processing on the UI thread. And that, in turn, means that during that processing, your app is ignoring all the messages Windows is sending it, like the "hey, somebody just Alt+Tabbed to you, so bring yourself to the front" message.
You either need to sprinkle your code with frequent calls to Application.DoEvents (not recommended, but could work if you don't intend to maintain this app long-term), or move your long-running logic into a background thread so your UI thread can stay responsive to messages.

How to resolve Windows Forms designer issue - controls move on debug?

Is there a reason / fix for this weird designer issue (at least, I think it's related to the designer), whereby the controls on the form do not appear as they do in the design window when I debug the application..!
Please see the following two screenshots to demonstrate the problem (note: I have blacked out some of the content of the form, this is not the problem):
Picture 1: Showing how the form appears in the designer view
Picture 2: Showing how the form appears in debug mode
You can clearly see that some of the buttons have moved position on the form.
Note: At first glance, this may appear like a duplicate of: Windows Forms Designer destroys form layout. However, I have not installed any additional tools or components. This is simply a standard "vanilla" build of Visual Studio 2012 on Windows 7 32-bit.
I've also come across this question: UI Controls Overlapping & Fonts Issue in Windows Forms Application. However, I am not using "large fonts", nor am I using any non-standard fonts on my controls (all label and button text is left as default). Still, I can see how this would affect the control positions and will do some more checks in this area.
There's nothing happening within the form's Load method.
I'm also using TFS 2012.
What could be causing this? Is there anything I can do to fix it?
EDIT: I've removed the font property for each label and button control, allowing the system to set the default value. Still no change. Interestingly, if I open the form in design mode, then save it, then close it, then open it again, the buttons have moved... If I do this a few times, the buttons migrate until they're off the form.
OK, I've found the answer, after a bit more fiddling. It seems to be related to the Anchor property on the controls. I made a bunch of changes, testing between each change to see if there was any difference. When I selected all the controls and set the Anchor property to Top, Left, this solved the issue.
I hope this helps someone else at some point!

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.