How can I solve this strange VS 2010 form design view issue? - visual-studio-2010

The problem: In VS2010, I have a form with a broken design view. It's breaking on a couple of Atalasoft imageviewer controls.
The weirdness: Took me some time to figure this out, but if I go into the forms designer.vb file, and comment out everything regarding these controls, save, uncomment, and save again, the form design view loads perfect. NOTE: I'm not changing anything. Just commenting/uncommenting portions of the designer and saving.
The form design view continues to work fine until I do any of the following:
close the form design view and the designer.vb file and try to view again.
close the solution and reopen.
After doing either of these things, it's back to square one and I have to comment/uncomment/save to view the form designer again.
I'm on Win7, 64 bit. I have worked on this app in the past with no issue. The app builds and runs just fine. It's just a VS form design view issue, and I'm flummoxed.
I'd love to hear any thoughts on how I can solve this. If I can provide any more specific info, please let me know.

I've seen this happen rarely, when something odd gets into the designer file for a form and the designer can't figure out how to display things anymore. A third-party control being part of it could be indicative of some bug with that control's designer-related code.
One thing to try might be re-creating the form in question from scratch, and see if that fixes it. Perhaps something inadvertently got fubared. Also see if there is anything out there with others having designer problems with the same control(s) in question.
Sorry can't offer more direct help; maybe someone else has experienced something more closely related.

Related

Form1.vb [Design] is empty

so I have this project that I use for work, and I went in to add some features.
It's basically a customized calculator.
While I was working, I clicked on my Form1.vb [Design] to look at my form. (Which is my main form)
I got a Windows Forms Designer error page. It had a problem with a particular line of code, even though the app ran and functioned correctly. I've come across this before a few times. I always clicked "Ignore and continue" and it was fine. This time my main form (Form1) was completely blank as if it was a new form. all of the code for my buttons/text boxes, etc... is still there.
is there a way to get it back? is it just hidden somewhere?
If anyone knows what's going on, I would really appreciate any help you could offer.
I attached a screenshot of my last working version of the app. Before the additions I was trying to implement.
I'm not super knowledgeable with coding, but I get by with some intermediate projects.
So I apologize if I don't know a lot of the terminology.
Thank you.

Layout corrupted in ADF projects

I'm working on some projects on Jdeveloper 11.1.1.2.0 IDE and encounter an annoying problems. The layout of jspx pages corrupted, all control attached to any page disappear without a trace when running project. They dont show in design tab either. The problem appears suddenly when I modify some page.
Now I cant working on the project and have to restart project from scratch. So if you have encountered and fixed the same problem. Could you please show me how to do it. I'm very grateful to hear any suggestion.
Thank you.
Your description doesn't allow any educated guess on what happens. Can you at least paste the page source that you encounter the problem with ?
Often issues like this occur by developers placing the content to a facet that is not made for this and that does not stretch. Or if the a tag is not closed properly or missing (the page source editor should flag this)
Before starting from scratch, which should not bee needed at all, try JDeveloper 11.1.2.2 to reproduce it in a later build.

Expanded/collapsed state not saved after closing file

In Visual Studio, you can expand and collapse code without using regions, for example in a code-behind page you can collapse methods, etc... And in an ASPX page you can collapse tags, tags, etc...
It's useful when you have a long page and you want to focus your development on a specific part. What's cool about it too is that you can close the file and reopen it and the state of the expanded/collapsed blocks is saved exactly as you left it.
Except in one instance. That state is not saved for tags in ASPX pages, where it would be most useful.
I know there are some good plugins out there for VS but I couldn't find one that addresses this issue.
Has anybody got a solution?
Before you mention custom controls, they are not always convenient or feasible when trying to keep a page short and I don't consider this a solution to this problem.
Looks like this issue will stay unresolved at this time.
I opened a bug report on Microsoft Connect, if this issue is important to you please vote it up!
https://connect.microsoft.com/VisualStudio/feedback/details/613221/expanded-collapsed-state-not-saved-after-closing-file

Can anyone explain why my workflow designer is so messed up?

I'm trying to learn TFSBuild 2010 and workflows and I found using the designer was very confusing. Then I realized from seeing screenshots of other peoples workflows, my designer is clearly messed up. Take a look at this:
http://imgur.com/uoKJ8.png
Something is very strange here. As I click on each task the borders for that task show up but this can get extremely confusing when there is a lot going on.
Yes, your designer is messed up. Why? Dunno.
First thing I'd do is update your graphics card. WPF is sensitive to bad video drivers.
Second is to go to Tools-Options and check out the Workflow options. You can change the "theme" of the workflow there. Change the theme, restart it and see if that makes a difference. If it works, you can try going back to the other theme.
Lastly, I'd definitely open a Connect on this. Check for the link under the Help menu.
Could it be that the XAML file for your workflow has invalid markup and is corrupted? Does it look the same when you create a new/empty workflow?
I'd say that if its happening for all workflows, including new ones, then you probably should try posting on a Microsoft help forum like this one.
Can you show your XAML file? Seems that it has more to do with the rendering of the Rehoster.

What's the state of play with "Visual Inheritance"

We have an application that has to be flexible in how it displays it's main form to the user - depending on the user, the form should be slightly different, maybe an extra button here or there, or some other nuance. In order to stop writing code to explicitly remove or add controls etc, I turned to visual inheritance to solve the problem - in what I thought was a neat, clean and logical OO style - turns out that half the time inherited forms have a hard time rendering themeselves in VS for no good reason etc - and I get the feeling that developers and to some extent Microsoft have shunned the practice of Visual Inheritance - can you confirm this, am I missing something here?
Regards.
I thought they had more or less sorted the desktop designer issues in 2005.
Have you tried the usual culprits?
No abstract control types
No constructor arguments in any form
Initialisation moved to Form_Load as opposed to the Ctor
No controls in the same project as the usercontrol/form that they are put inside
Close all documents -> Clean -> Rebuild
Restart VS
I seemed to think that as long as you did all of the above it worked..... mostly.
I am studying towards the (admittedly soon-to-be-obsoleted) MCAD, and part of the WinForms element was Visual Inheritence.
I personally have had no major problems with it, however, there are considerations to take in to account.
For me, the main problem has always initialization.. You need to remember that the designer cannot/does not instantiate forms in the same way it does at run time (similarly, it cannot do this with web dev, which is why care is needed with custom control rendering).
Also, once a form is changed, a complete re-build of the project is required in order to propagate the changes to the form to the child forms that inherit from it.
I personally have seen no evidence to suggest that it has been "shunned". AFAIK, its still good practice to exercise code re-use where possible. Visual inheritance provides that.
May I suggest creating a new question with the actual problems you are having, with sample code? We can then look at it to see if we can get it working and explain why :)
I've seen some problems in VS2005 with this. They were mostly due to problems with construction of the forms-objects in the designer. There were issues with code that tried to access the database from the form-constructors etc.
You can debug issues like this by starting a second instance of visual studio and loading up the first instance in the debugger. If you set breakpoints in your code you can then debug what happens in the designers in the first instance.
Another problem I can remember was generics in form classes
public class MyForm<MyObject> : Form
this won't work
I often stumble upon such problems in Visual Studio. In many cases MSVS forms designer fails to render form correctly. Back in the days I worked with WinForms I had to do all kind of weird tricks to enable some complex scenarios. However I think that using visual inheritance is very beneficial and should not be thrown away regardless of MSVS designer bugs.
I think I've found a way how to avoid this problem.
Don't hook the Form_Load Event in your parent form, this will break the designer.
Also don't take the Default empty constructor away from Visual Studio in the Parent Form. If you want to have Dependency Injection, create another constructor.
Like this:
public ProductDetail()
{
InitializeComponent();
}
public ProductDetail(ISupplierController supplierController) : base()
{
InitializeComponent();
this.supplierController = supplierController;
}
You can then still do this from your inherited Form:
public NewProduct(ISupplierController supplierController)
: base(supplierController)
{
InitializeComponent();
}
This worked for me so far, and I had some weird designer issues too.
cheers, Daniel
Read this: http://cs.rthand.com/blogs/blog_with_righthand/archive/2005/11/10/186.aspx
AFAIK, there are still issues with Visual Inheritance and objects that rely on collections for the design elements, typically grid controls etc. I believe MS still have removed the possibility of changing f.ex. a GridView in an inherited form/usercontrol etc. But other controls like TextBox, Form, UserControl, Panel etc. should work as expected.
I've so far had no problem with VI using 3rd party grid controls myself, but you have to be careful, in particular, removing items from collections MUST be avoided.

Resources