question

KurtKregger-6402 avatar image
0 Votes"
KurtKregger-6402 asked MinxinYu-MSFT answered

UI Option missing when adding new item.

I'm using the latest version of Visual Studio 2022 as of 11/8/22.
I created a winform app for visual c++ cli.
Desktop development with C++ and .NET desktop development workloads are installed.
I have no problem working with the main form, although Visual Studio 2022 is a bit flaky when it comes to displaying the form designer.
When I try to add another form by selecting Project->Add New Item... the UI option is missing.
So, it's impossible to add another form to the app.
My question then, is what do I have to do to make the UI option available?

c++windows-formsdotnet-cli
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I cannot reproduce your problem.
Did you have Project->Add New Item ->CLR option?
258438-image.png


0 Votes 0 ·
image.png (12.7 KiB)

Maybe you did not select the project node in Solution Explorer before executing Add New Item?


0 Votes 0 ·
MinxinYu-MSFT avatar image
0 Votes"
MinxinYu-MSFT answered

Hi, @KurtKregger-6402

Try installing C++/CLI in Visual Studio Installer. CppCLR_WinFormsProject looks like a user-defined project template.
258890-image.png
258906-image.png

Best regards,

Minxin Yu


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.





image.png (21.6 KiB)
image.png (27.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KurtKregger-6402 avatar image
0 Votes"
KurtKregger-6402 answered Viorel-1 commented

@ MinxinYu I did not have Project->Add New Item ->CLR option.
@Viorel-1 Selecting the project node doesn't seem to make any difference.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


I did not have Project->Add New Item ->CLR option.

What options do you have?


0 Votes 0 ·
KurtKregger-6402 avatar image
0 Votes"
KurtKregger-6402 answered

258846-capture.png



capture.png (5.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KurtKregger-6402 avatar image
0 Votes"
KurtKregger-6402 answered Viorel-1 commented

I don't know if it makes a difference but, I'm using the community version of vs 2022.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Windows Forms are not supported by New Project dialog in C++/CLI. How did you create the project? Also check if the problem is reproducible in a new simplest project.


0 Votes 0 ·

258862-capture-ii.png





This is the project type that I created.

0 Votes 0 ·
capture-ii.png (5.4 KiB)

I have the same problem when I create a new project of the same type.

0 Votes 0 ·
Viorel-1 avatar image Viorel-1 KurtKregger-6402 ·

I do not think that this kind of projects is included into Visual Studio.


0 Votes 0 ·