putting controls on forms

jeff luminais 21 Reputation points
2022-12-02T19:39:08.137+00:00

Hello, Im running windows 11 and have visual studio 2022. Im making a vb.net applications. Ive selected windows forms application. I have been able to add a number of controls such as text boxes, list boxes and button, but I need to add a windows media player control to it. I went in the toolbox and successfully imported the player along with some other controls (windows forms 2.0). But they are all greyed out along with the media player. Also I cannot find the msserial control anywhere. Does anyone have any insight into this?
Thanks,
Jeff

Developer technologies | VB
{count} votes

Answer accepted by question author
  1. Jiachen Li-MSFT 34,231 Reputation points Microsoft External Staff
    2022-12-05T05:59:24.427+00:00

    Hi @jeff luminais ,
    According to Using the Windows Media Player Control with Microsoft Visual Studio,

    You can add the Windows Media Player 9 Series or later ActiveX control to a .NET Framework application through the Toolbox in Visual Studio.

    So you should create a Windows Forms App(.NET Framework), not Windows Forms App.
    266920-image.png
    Best Regards.
    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.
    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.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Castorix31 91,496 Reputation points
    2022-12-02T19:45:23.023+00:00

    Select a .NET Framework project, not .NET (Core) :

    266743-net-framework.jpg


  2. jeff luminais 21 Reputation points
    2022-12-06T16:00:03.897+00:00

    Yes, what I realized is that in my copy of visual studio which is the community version, I am not provided an option to creat a net framework using vb. The only option I have is to use c#. So Ive decided to just go ahead and convert it to c#. I found a useful web tool to do a line by line conversion from vb6 code to c#. Its far far from perfect but it did about 40% of the work for me. Thank you for your response.
    Jeff


  3. Albert Kallal 5,591 Reputation points
    2022-12-08T00:16:04.277+00:00

    As a follow up, if you install the correct bits and parts, and make sure you create a windows vb.net "framework" application?

    Then yes, I am freely able to drop in the windows meda player
    (and I am on an new laptop - windows 11).

    So, after you create the project, then you most certianly do NOT want to add activeX form 2.0 controls.

    So, with a new project, then I add the media player to the toolbox like this:

    268431-image.png

    then choose this one:

    268395-image.png

    Ok, now create (add) a new form, and drag + drop the windows media player onto the form.

    Thus this:

    268300-image.png

    So, media player - no problem.

    Now the ms-serial control? Hum, that we need some googling for this - I'm not sure if the msserial control is avaible, but you can most certainly use/create serial control code in vb.net.

    As a FYI?
    The above is being done on a new windows 11 computer, and vs2022 community edition.

    Edit:

    And I do see the serial control in the tool box - you don't even have to add it.

    thus:

    268330-image.png

    So, from what I can tell, both the serial port, and the windows media control exist, and work fine in vs2022 community edition. They have NOT removed these features.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.