So I have been working on a project using C Sharp and WPF for a while now, and now recently several of my user controls are hidden in Expression Blend. I tried show all, setting visibility to Visible in the gui, cleaning the project build, rebuilding, restarting, etc... nothing seems to work.
As you can imagine, this is very frustrating, and any help would be greatly appreciated, thank you.
Figured out a way around it. The problem is somehow related to the fact that I have several UserControls extended from a class that extends UserControl, but which has no XAML file itself.
Changing the xaml root from something like MyCustomUserControl temporarily to UserControl will allow the content to appear. Once done editing, change the root back so your program can run.
Related
I have to modify an old VB6 program that uses ActiveReports 2.0 at work and I am having some problems (BTW I have never used this program before and only have a basic knowledge of VB6)...
I have to make some text boxes biggers which is pretty easy to do but as soon as I move them a whole section of text (and not simply the content of that text box) disappear.
I have noticed that it was in some sort of section (sorry, I don't know how they call that) which englobed those text boxes so I made it bigger and that made no difference.
What could be causing this?
Thank you!
Nick
It sounds like the TextBox is inside a UserControl. A UserControl is created by a developer, and is basically one control with any number of other controls in it. You can check to see if there are any User Controls in your project in the Project Explorer (Ctrl+R).
One way to know exactly what class the control belongs to is to open your form in design mode (Shift+F7), click on the control, and look at the Properties window (F4). The drop-down list should show the currently selected control's class name in bold, then the name of the object.
What is the control's class? If it is anything other than TextBox, then this would explain the unexpected behavior you experienced.
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.
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.
As you can see from the screenshot, vs2008 thinks asp tags are hyperlinks. I have reset all the settings on it but the issue is still there. I have tried on different projects and the same issue is present. I have moved the projects to another visual studio installation and problem has gone until I move them back.
Any one knows why this happens?
alt text http://img12.imageshack.us/img12/9033/20090531191305.png
http://img12.imageshack.us/img12/9033/20090531191305.png
Does it happen for tags without an asp: prefix.
e.g. Can you create a UserControl, and drag that in and give it a different tag prefix
<cc1:MyCustomControl />
If not, then it sounds like something has gotten set on your system that treats asp as a protocol :(
But to be honest, I'm at a complete loss as to why this might happen.
Must say it is strange. Although I am clueless, I will still try.
Are those real hyperlinks or just underlined text? If underlined text, then you can change the settings (since you have mentioned about resetting the setting, this won't work). If they are real hyperlinks, I am stumped.
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.