VB.2010 form not showing controls in the IDE - vb.net

I have a VB.2010 Windows Desktop App that has been running for years.
As of this morning there is 1 form out of dozens of forms the app has does not show any of the controls in designer mode and not even the correct size. Look like a brand new form except the form does not any text (new form would be form1, etc.). Yesterday there was no problem.
The designer module is there as is the resx module.
When looking at the Solution Explorer showing all files the modules appear but no indented under the vb module. It is almost like VB is treating them as totally separate modules.
Went to a back of the source folder from 5 months ago and it has the same problem for the same form.
If I run the app the form does show all the controls but I am not able to see / change the controls in designer mode.
Every tried re-booting the machine.
Since the 5 month old backup has the same problem it is not something in the source. So restoring the source would not help.
Looked at another VB.2010 app that is very similar to the above that uses the 'same' forms but in a different folder and this program does NOT have the problem.
HELP!!

All the controls where there. I fixed it by removing and deleting the 'bad form'. Then doing an add existing items from a backup folder (actually created when the form was still bad).
So there is/was nothing wrong with the source and I have no idea what caused it, why backups didn't work on 2 PCs, etc. etc.
Don't know if it will stay fixed but I am ending the day (yesterday) on the above good :)
Filed in: X-Files

Related

Trying to open code for a control/form brings up Form Designer code

I used to program in VB6 professionally (up to about 6 years ago). Now I'm trying to write a personal program in Visual Studio 2017 Community. I'm having a problem:
I had the program finished but needed to embed an ICO file in the EXE and couldn't get it to work. Somewhere in the process, I screwed something up. None of my "code-behind" stuff is running. That is, form_load doesn't run, none of the code associated with the buttons runs when clicked upon, nothing. Double-clicking a button to see the code behind it actually brings up the Form1.Designer.vb window (which I'd not seen before).
It's as if all the code behind the form has been orphaned and the form and the code which had been associated with it have been separated. I'm sure I did something stupid while monkeying with settings to try to get the ICO file to embed but I have no clue what I did wrong.
Suggestions? Please. :-/
--HC

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.

"Action - Go to report" in VS2008 reportviewer not working

I have an SSRS report which drills through to sub reports via actions. The report functions correctly in the VS environment, and correct once deployed to the server and viewed through a browser.
The report however is also viewed inside our in-house app via a Microsoft.Reporting.WinForms.ReportViewer - and while it renders on screen correctly, clicking the element that would normally take me to a sub-report no longer functions.
I have had a look around and there seemed to be an issue around VS2010 SP1 where this stopped working, however I'm currently stuck with VS2008. This seems to be the majority of results I'm getting.
Anyone have any ideas?
Many thanks.
OK have found issue.
The text box in question had three place holders. A reference No, A date and an age. I wanted to trigger the sub report if someone clicked on the reference no. While this worked fine in VS and IE, it failed to work in the Microsoft Report Viewer control.
I have now set the action against the containing text box, rather than against a single placeholder/expression within that box. While this has solved the immediate issue that I have, it would not work if you wanted multiple actions from different placeholders in a single text box.
But for now, I'm all good, and all solved.

Old deleted form still running at startup vb.net

I'm new to vb.net and need some help.
I'm not sure what's happening but a deleted main form loads on start up even after setting a new form as start up.
I took a few buttons and copied it on a group container and named it Dial Pad on the old form. After testing to see if it works I adjusted the dimensions and ran again but this time it stayed the same. I clicked on the buttons but nothing happened. Check the code and there was code in it and correct. However there seem to be other set of buttons name as same but with a 1 at end.
I checked the solution explorer and it didn't show, only the originals showed. After frustration I created a new form and copying the code and created new controls. I deleted the old problematic form and set the new one as start up but the old form with the dial pad still appears and only exit button I added and coded works. The datagridview on old forms works as well and is the old way I can get to the other forms which still work.
This problem sometimes indeed occurs. The solution is pretty simple. Go in the menu to Build > Clean Solution and rebuild. Or else, open the context menu on the solution node and select Clean Solution.
Screenshot of the menu:
Screenshot of the solution node context menu:
I had the same problem with a web page in VB. Rebuilding website/solution didn't work for me. The only things that worked were 1. Completely restarting VB or 2. File -> Close Solution and then loading it again File -> Recent Projects and Solution. This one at least spares some time.

Forms open and load very slow. Sometimes they won't open

I have a relatively small VB winforms project.
It is currently used to launch numbers hyperlinks and some apps on a server.
There are a couple functions that do all the work, but the it really boils down to:
System.Diagnostics.Process.Start("iexplore.exe", urlVar)
or if it is an app sitting on the server, the variable passed into the function appLinkVar will contain the need file path to launch the application.
System.Diagnostics.Process.Start(appLinkVar)
The "items" are stored on a SQL Local Database (.mdf)
Id, appName, appLink, appClickCount, appFavList,anddecision, which tells the function if it is calling a website or opening an executable.
Currently, there are forty rows in the database and I project 150+ in the end that need to be updated centrally and often (weekly). But that's a different question for later. The reason I added in it in this question was for insight as to why I am using a database instead of a Setting or XML file for some links. (better suggestions welcome)
My admin main form loads Visible = False and loads the icon in the system try. So you can't actually see the first form that opens. It is a hidden admin window and it's main purpose is to put the icon in the system tray. The green RJ icon - http://snag.gy/VBa6c.jpg
Then all of the app interaction is around the notify icon. Example: the app loads on hover. right-click for settings and options etc.
Once the primary form loads, on mouse over the "Primary Label" for example and the white form to the left appears and so on. Not much to it. http://snag.gy/excKr.jpg
The Frequently Accessed items is currently stored on the database called appClickCount, this will be coming off of the database and to another recommended way of storing the data. But when I initially added the database, I noticed some lag in the main form loading. It would take it 5-7 seconds to populate the Frequently Accessed Items List and so on. So I changed the code from mainWindow.show() to mainWindow.visible(). Worked great for me. opened and closed very quickly. But after some use today by a tester, the application became almost unresponsive. He clicked on the notification icon numerous times and the app failed to load. Then threw a SQL time out error. It was the end of the day and I couldn't grab a screenshot.
I need to make this more reliable.
After some discussion the other day on SO, I was talking to someone that recommended I re-write the app in C# WPF, and that is definitely the plan. But I need this thing to past testing as is in VB this week. Where can I start troubleshooting the delay in opening? What other suggestions do you have to improve the application? Do I need to have an invisible form load first so I have access to a system tray icon or is there a better way?
I have talked to quite a few people on here lately and got some really good advice, I figured I would lay it all out here and see what input you guys can give a new guy... I'm also gonna go hang in the C# room for a little bit if you have any further questions.