VB.NET图片框以不同的大小模式显示错误的图像

I have a project that displays images based off of serial data. Specifically the program will display a compass and arrow based off the bearing calculated. The problem I am having is on one of the tabs occasionally, one of the picture boxes will change display to a different picture and the sizemode property changes from stretched to default (by looking at it). There is no code that would trigger this particular image box to change the image. And there is no code in my project that changes sizemode.

I have tried storing the particular image location to a string and calling it using a tabselected.indexchanged sub triggered everytime a user switches from one tab to another and verified this method is effective by having it display a msgbox as well. This works until the bug shows its head. When the bug does appear and the image box for some reason changes, even switching tabs does not cause the image to get redrawn as to what was stored.

It seems like a resource is getting hung up or something and it defaults to a specific image but I cannot be certain this is the issue or track it down. Please help.


Unless someone has already experienced exactly the same thing, I doubt that you're going to get any help. What you need to do is create a test project and then build it up piece by piece to resemble your current project until it breaks. You can then provide us with specific instructions on how to reproduce the issue if you still need help to fix it. If your test project never breaks, it may just be something corrupt in your original project and you can either replace the affected form with a new one or migrate everything to a new project.

Hey Matt, be more specific in your question, not less. Find where, in your code, the problem happens. To you, the background information you have given may be all that's needed, but to someone else, they have absolutely no idea.

Ok, I will try to set something up in smaller project. It is somewhat difficult to repeat. I have a feeling this issue will take some time to track down.