Resources causing transparent and erratic window behavior VB.net 2012 - vb.net

I'm not entirely sure what caused this, but just prior I had deleted an image that was set as a tab panels background image which caused some crashing of vb studio when opening anything to do with the project resources. I removed the image, then re-added it and everything seemed okay.
Now, no mater what I do i get all sorts of funky draw issues at runtime with my project; such as transparent text boxes in child forms (and if they are called not as a MDI child) and weird stuff such as clicks on the taskbar registering on windows behind.
Visual studio has also crashed a few times, especially when doing anything to do with the project resources.
Example Problem
Any one have idea what may be causing this? It seems to be related to the project resources or possibly tab panels.
(Visual Studio 2012 & Windows 10)

Just in case somebody finds this Question after all this time. I had the same Problem and i found, that the Transparency-Key of my form was set to White, so everything White became transparent (Textboxes, colored Labels, etc.). After deleting that, everything worked fine.
I use Visual Studio 2013, don't know if this doesn't work in the 2012 Version.

Related

VS 2010 Windows Form App - One Form has a different visual style - why?

I am building my first "real" VB Window Forms Application (I'm a "traditional programmer") and my application has perhaps half a dozen forms.
On execution all of these forms have the Windows 10 visual style (eg: grey on white max/min/close buttons at top right)... except for 1 form, which seems to be rendering in Win XP style (eg: Blue and red button style).
I have checked that "Enable XP Visual Styles" is UNClicked in the Project Properties, but this one form stubbornly refused to change.
I have a number of my forms that also appear in "XP style" in the VS Designer, but execute fine.
I suspect I may have enabled/disabled the "XP Visual Styles" option a couple of times, and perhaps initially created some forms when this was in different states... although I have no idea if this would have been the cause.
I really want this one form to be like all the others...
any ideas please? I am using VB in VS2010 (a bit old, but what I have to hand)
As I am quite new to VB so tell me what I can provide to help..
Many thanks,
David's comment has solved my immediate issue:
The single form appearing differently is indeed using Show() whereas the others are all ShowDialog(). There is no reason for me doing this, so I have changed it.

why does Visual Studio modify "Windows Form Designer generated code" on designer open?

When working w/ a WinForm project in VS.NET 2015, our team has noticed that the mere act of opening a .VB form in the designer view (default action when double-clicking the file in Solution Explorer) will cause VS to modify many object properties in the "Windows Form Designer generated code" section of the actual .VB code-behind. It seems to be limited to the .Size and .Location properties for sometimes dozens or more of UI objects, always changing their X,Y coords just slightly.
Mind you we don't perform any action to drive this -- simply open the file (obtained from source-control and residing in the local solution/project) in VS.NET's form designer by double-clicking the file in Solution Explorer, and bam -- it has the "unsaved" asterisk and if you save it and compare to source control version you can see the modifications already made.
I couldn't find much on this. Is this a known behavior? Any idea why it does this? Kind of reminds me of the old days w/ MS FrontPage's designer view, and even the early days of ASP.NET in VS which would apply some HTML changes if you opened a WebForm in designer view, until they gave the option to disable that on a later release.
thanks for any input.
UPDATE: this appears to be continuing even with myself as the only editor of the .VB form in designer. various form elements are shifting their position very slightly. Here's a diff screenshot between my last check in and today, and I know I'm the only one editing:
...there are many like that. Always these two properties, always just a few pixels difference.
I don't have an specific answer for this, but since this drove us crazy a bit a few months ago with my team, while working on a WinForms project, I am glad to share my experience!
Every time someone opened any form on VS2015, it would ask other people who has the same solution open at that time to reload the code. We first thought the third party controls (at that time it was both DevExpress and Infragistics) we are using were re-generated on designed initialization - because they tend to do that a lot but then we realised this kept happening on forms that only contains .NET controls.
Now the funny part. This only happened to us on VS2015. We were using VS2013 before, without this annoying problem.
Long story short, then we realized the screens we are using have different DPIs, just like Cody Gray said. I am not absolutely sure if this was the reason, but since we started using TFS, obviously we don't have the problem anymore... Hope this helps somehow lol.

Executable Buttons Not Displaying

I created a VB.Net application with a target .NET Framework of 4.5. The application runs fine on my computer (or any system with Visual Studio installed). But when I try to run the exe generated from the build, the application loads, but the buttons are not displaying. There is an outline where the button is, and you can actually click the button to perform the action just fine. I assume this has something to do with a reference problem, but I really don't know for sure. They are just standard Windows form buttons. No images attached.
So I figured out the solution, but not necessarily the problem. The button had a BackColor property set to Black which is the same color as the form. For some reason, on certain machines this caused the button and the form to blend together. Changing the button BackColor to something different (such as Control grey) worked just fine.

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.

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!