Vb.Net PictureBox Resize image in runtime - vb.net

appreciate your help.
So I have an image (293 X 117 px) being placed in a PictureBox inside a Form. The layouts of control is perfect in the From; however, when I run the application the form is displayed but it seems the image is resized!!
I have the the SizeMode set to Normal

This worked
Disabling DPI-awareness to fix HDPI / scaling issues with Windows Forms Designer in Visual Studio:
https://learn.microsoft.com/en-us/visualstudio/designers/disable-dpi-awareness?view=vs-2022

Related

Windows Forms/Controls Resized on Wide Screen Monitor

Here at work I have been relegated to working on an old 4:3 monitor. The application I am working on in VB.NET (VS 2008) has several forms and controls that are sized to a specific height and width. They look fine on my monitor, but when I recently released a Beta for Users to try, the users that had widescreen monitors had stretched dialog forms and stretched controls on those forms. Is there a form property to set, or a programming technique to use, in order for the form and all of it's controls to display EXACTLY to the width and height specified?
I ended up fixing the problem myself by setting the .AutoScaleMode of the form to "None", and setting all my fonts to use pixels instead of points.
Unfortunately, this was not an issue of code, but rather of design. Sure, it's easy enough to post code snippets, but if I need to post a whole windows form application that's another story altogether.

How to have a TextBox control fill a Split Container panel?

I am running Visual Studio 2010 Professional (10.0.40219.1 SP1Rel) with no updates showing in Windows Update. When I drop a TextBox control into a Split Container panel, make it Multiline, then Dock in Parent = Fill, it shrinks down to 1 pixel wide and disappears. Of course, at runtime it is invisible.
Is this a bug? Is there a fix? I actually don't need text input - what I want is to display text in a resizable panel, with scroll bars. I could perhaps put code on the events (SizeChanged, SplitterMoved, SplitterMoving...) but that's an ugly solution. Is that the only one?
Apparently I didn't realize I had put a Flow Layout container inside the Split Container panel. This was preventing it from filling the panel.

Scale winform to lower resolution and all controls in vb.net

I made an application in Vb.net with winforms at a resolution of 1920x1080 not thinking it may need to run at a smaller resolution. When I run it at 1280x800 all the controls flows off the screen and doesn't fit even if I anchor/dock or use auto-sizing. I have tried putting my user controls in a panel and anchoring that too. Can you please give me advice on what I can do next, I'm out of ideas.
You could collapse or hide part of the form. Surely filling a 1080p panel is information overload. Also consider placing related controls in their own forms.

Scale image size (Image control on an Access form)

I've done this before, but I'm working in 2010 now and it doesn't seem to be working.
I'm trying to make a thumbnail view of an image control. The pictures I store (text field, just linking to a directory) are large and have their own form to open and view them at resolution, but I want to display a small thumbnail of the picture.
I have an image control with the control source set to the image field of my record source. It changes fine with I navigate records, but it shows a zoomed "window" of the image instead of scaling the image down to a thumbnail like it worked in the past.
I've tried the "size to fit" option, thinking that would do the trick but it doesn't.
Is there a different property that I could use? I don't mind writing a little VBA for this either, but I figured it would have worked by just using the form controls.
I just tried this using a regular old Image control in Access 2010 and it worked fine for me when I changed its dimensions to something "thumbnail sized" (0.5" x 0.5") and set the Size Mode property to Zoom.

AutoScaling WinForm Display (Small, Medium)

First and foremost, please forgive me but my screenshots are in French due to my Windows installation at work. It is still very easy to understand though. I'll include screenshots to make it more visually appealing.
Here's some background information:
Windows 7 64bit
Visual Studio 2010
Default display is 100%
AutoScaleMode: DPI
AutoSize: True
My application is a windows form that was developped in a default (small - 100%) display. Like so:
As you can see, the "Petite" or Small display is the default selection.
Small Display - 100% (default)
Here is how my application looks with this setting. This is the correct display
Medium Display - 125%
The red rectangles point out the unwanted empty space.
I have tried:
Anchoring / Docking my controls such as my split containers, table layout panels, list views on Form_Load and via the UI. This didn't work.
Adding a split container to the form, and all controls respectively separated into it
Adding Table layout panels, where all textboxes and buttons are located in their respective cells
I really thought it was having a scaling problem because of the anchoring and docking. Although that didn't seem to be the problem ... What seems to be having trouble is the Tab Control and Listviews ...
Some users (most) have their settings as the default (100%) but there are a few who have it at a Medium setting, causing this scaling issue. Is there a way to fix this?
I cant see your screenshots or links for some reason so I cannot visualize the problem. If scaling is the problem, try setting AutoScaleMode to None.
I recently had to do this because my winform app was image intensive and it would not render correctly on Medium Settings because I built it using the default Small Settnigs display. Changing scale mode to None worked for me.
I fixed my issue by putting the tab controls and list views in a tablelayoutpanel. Everything that wasn't scaled properly had to be put inside a TableLayoutPanel. I kept my AutoScaleMode to DPI and AutoSize to True
Be sure to dock everything in their parent containers.
Here's the document outline for the more visual (like me):
Just click on the form and go to property pane. Find the Anchor element and click the dropdown. You click on all the lines in the square structure to become grey. Then click enter. Problem resolved.