Results 1 to 3 of 3

Thread: Wrong Menustrip

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2020
    Posts
    68

    Wrong Menustrip

    Does anyone know anything about this menustrip? I was expecting a different one, then got this one. I did a search and the only one anyone else seems to have is the one I was expecting. What is going on?

    Just to be sure I'm clear, I just uploaded the other MenuStrip. I have 2 versions of VB the 2010 version (which has the right menustrip (Below)), and the 2019 version that has the menustrip I'm asking about(Above). The one above won't even let me see the dropdown menu items in design time. In order to put code for them I would have to select them in the code window.
    Attached Images Attached Images   
    Last edited by vb6tovbnetguy; Jan 22nd, 2021 at 12:58 PM.

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    106,288

    Re: Wrong Menustrip

    There is only one MenuStrip. What I suspect has happened is that you have created a new project and you have used the .NET template rather than the .NET Framework template. This root issue has come up numerous times recently, since the release of .NET 5.0, because people don't take the time to observe what they're doing.

    Previously, .NET Framework was all there was. Some time ago, Microsoft created .NET Core and you could create projects that targeted one or the other. .NET Framework was developed up to version 4.8 and .NET Core was developed up to version 3.1. Going forward, there isn't going to be a distinction so Microsoft released .NET 5.0 without the designation (like they dropped the ".NET" on VB and VS in 2005). .NET 5.0 is based on .NET Core but it has been developed such that it provides some features and functionality that was not available in .NET Core 3.1 but was in .NET Framework 4.8.

    Windows Forms was not supported at all in early versions of .NET Core. C# WinForms support arrived in version 3.0 or 3.1 (can't recall exactly) but VB WinForms support didn't arrive until 3.1 and, even then, it was very much in preview. With .NET 5.0, VB WinForms is a first class citizen but there are still some things that haven't been fully ported over. Editing of ToolStrips, MenuStrips and StatusStrips is one of those things. If you are unable to edit a MenuStrip as you expect then it's almost certainly because your project is targeting .NET 5.0

    The solution, if your aim is to get the same editing experience of MenuStrips as you're used to, is to create a new project that targets .NET Framework. When you create a new project there is a template named "Windows Forms App (.NET)" and another named "Windows Forms App (.NET Framework)". The former will target .NET 5.0 by default and allow you to change the target to older versions of .NET Core, while the latter will target .NET Framework and select the last version you used by default. If you select the latter then you're using the same project type as you're used to. If you select the former then you're actually using a whole new experience in VS. That experience looks like the old one but has been built from the ground up for .NET Core and it still lacks a few features.

    Note that there's no easy way to convert a .NET Core project to .NET Framework or vice versa. It can be done but it requires you to get your hands dirty and likely make changes that you do not understand. For that reason, it is risky. That's why I say that you should create a new project rather than convert your existing project. Just keep in mind that .NET Framework will be supported for some time to come but it will not be developed past version 4.8. Not that WinForms is changing these days anyway, though. What that means is that you won't be able to upgrade to newer versions of .NET without either creating a new project in the future or digging into the bowels of your project. The good news is that project items can be copied from one project type to the other, generally without any changes required.

    So, if you're happy to stick with .NET Framework 4.8, create a new project now and stick with it. If you want .NET 5.0 and beyond, stick with what you have an live with the shortcomings of the WinForms designer for now, knowing that those shortcomings will be address in future versions of VS.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2020
    Posts
    68

    Re: Wrong Menustrip

    Quote Originally Posted by jmcilhinney View Post
    So, if you're happy to stick with .NET Framework 4.8, create a new project now and stick with it. If you want .NET 5.0 and beyond, stick with what you have an live with the shortcomings of the WinForms designer for now, knowing that those shortcomings will be address in future versions of VS.
    That worked. Thanks.

    I thought I was probably looking at the wrong side of the same thing, and the solution would be simple. I was not far along in this current project, so just starting over was not a problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width