Hi all i am new to wpf in vs 2010 .I cannot find it in the toolbox when i select choose item and in .net components it is already checked but it is not there in the controls list.Any idea how to add it?
You should simply create a BackgroundWorker instance in the code-behind.
Backgroundworker is not a WPF component, so you won't see it in the toolbox.
You have to create one in code-behind; import System.ComponentModel.
Related
In Visual Studio versions prior to VS2019, .NET framework 4.7.2, if you wanted to design a MenuStrip, you just added the MenuStrip to the form and start typing the ToolStripMenuItems. Like this:
I've recently moved to VS2019, and started to use .NET 5. If I add a Menustrip, I get an empty strip, which seems not easy to edit (I colored the background of the main form, to clearly see the white menu strip)
My question is: how to add ToolStripMenuItems?
I see the little arrow on the right, and I can select Edit Items, but to add a menu that way is quite cumbersome.
If I open an old solution in VS2019, I can edit the menu as I used to do. So it's not VS2019.
If I create a new VS2019 project using an old .NET version, I can't edit the menu, so it's not the .NET version
If I copy paste InitializeComponents from an old project to a new .NET 5.0 VS209 solution I cannot edit the menu
So, how to edit the menu? Is edit items really the proper method to edit your menus from now on?
I believe that the MenuStrip editor experience difference comes down to .NET Core vs .NET Framework.
Edit: .NET 5 = .NET Core vNext
We covered MenuStrips while we were doing WinForms in my C# class and this exact question came up. .NET Framework solutions allow you to use the convenient editor as you have demonstrated. .NET Core solutions do not.
The easiest way I found to build out my MenuStrip items when in .NET Core was to click on the menu strip, then there is a property called "Items" which is a collection. In the properties pane, you can click the three dots button to bring up the Items Collection Editor:
Here you can create new ToolStripMenuItem objects to build your menu.
Possibly related post, others suggesting this is a Core vs Framework issue: MenuStrip not allowing to create menu
This issue has been fixed
in Visual Studio latest release v16.10: 05/25/2021 (https://learn.microsoft.com/en-us/visualstudio/releases/2019/release-notes). I have tested this both in net 5 (current) and net core 3.1 (LTS).
Demo:
https://youtu.be/3s55hWrHx4U
You might have used the option that says "Windows Forms App."
This is wrong. You should use "Windows Forms App(.NET Framework)." This will let you edit the menuStrip control the easy way.
I need to create very basic single form application in my MS Visual Studio 2019, Visual c++. I prefer to design this form in designer. I create new application in my Visual C++ by selecting new Windows Desktop Application. As result I got main form that I can't design in designer. I prefer to have dialog style based form similar to About form that I can edit in designer as main form. How to achieve that?
I suggest you could try to use MFC to create a form based on dialog style
First of all, you should installed with the Desktop development with C++ workload and the optional Visual C++ MFC for x86 and x64 component.
And then you could create a form based on dialog style.
1,Use the MFC Application Wizard to create a new MFC application. To run the wizard, from the File menu select New, and then select Project. The New Project dialog box will be displayed.
2,In the New Project dialog box, expand the Visual C++ node in the Project types pane and select MFC. Then, in the Templates pane, select MFC Application. Type a name for the project, and click OK.
3,On the Application Type pane,under Application type select Dialog based. click finish, and you have created a form based on dialog style.
For more details I suggest you could refer to the Doc:
https://learn.microsoft.com/en-us/cpp/mfc/reference/creating-an-mfc-application?view=vs-2019
The inclusion of DataGrid and DatePicker controls was announced for WPF in Framework 4, but when I access to Visual Studio 2010 and I create a WPF project, I don't get these controls. What did I miss?
Thanks.
I hope I understood your problem, so here we go...
Instead of the DataGrid you can use the ListView with ListView.View set to a GridView. After this you have to create a couple of GridViewColumn objects, set their binding and then add them to the GridView.
I have an example of doing this (but i don't think it is the best one, because i'm kind of new to this programming stuff). If you want I could post it here.
Have you made sure the target Framework is set to be v4? They should "just show" in the toolbox if you're targeting v4 of the framework.
In my WinForms project I have multiple UserControl-s with the same name ("View"), in diferent namespaces.
If I understand well, the designer hides the controls with the same name as the designed control from the toolbox. So when I'm in design mode on one of the "View"-s I don't see the other ones.
Is there a way to change the name displayed in the toolbox for an UserControl ? I have tried using DisplayNameAttribute or ToolBoxItemAttribute with no succes. Also DescriptionAttribute doesn't see to work either (I was expecting the description to be added to the toolbox item tooltip)
Or is there another way to display multiple UserControl-s with the same name in the Visual Studio WinForms designer toolbox ?
Using Visual Studio 2008
You can do this if you add each control to a different tab in the toolbox (just right-click in the toolbox and select Add Tab. Name each after the namespace.). This is how VS supports having controls with the same names between WinForms and web apps, for example.
I'm trying to use some of the new MFC feature pack controls on an existing MFC app, with VS2008 SP1. None of the new controls appear in the dialog-editor toolbox.
Should I expect them to be there, and if so, do people have any suggestion for how to get them to appear?
Unfortunately there no IDE support for new "NextMFC" controls. There also no plans to add it to VS2008 at this moment, we need to wait for VS2010!