does visual studio 2022 support winforms for python

Yahya Abou Dalal 0 Reputation points
2025-03-27T15:36:31.09+00:00

I am unable to begin a python winforms project in visual studio 2022 .I installed all the python addons with no success.

Visual Studio Extensions
Visual Studio Extensions
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Extensions: A program or program module that adds functionality to or extends the effectiveness of a program.
271 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sander van de Velde | MVP 35,971 Reputation points MVP
    2025-03-27T20:44:52.36+00:00

    Hello @Yahya Abou Dalal,

    welcome to this moderated Azure community forum.

    I'm not sure which tutorial you are using but there are some resources availble like this youtube video and this (older) Github repo.

    Check out both approaches.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


  2. Michael Taylor 58,451 Reputation points
    2025-03-27T21:22:20.65+00:00

    Python doesn't support Windows Forms. Winforms is a NET technology. Please provide the instructions you're following to do this so we can understand what you're doing.

    Visual Studio does support Python and developing Python apps using standard Python frameworks as discussed here. To support Python in VS run the VS installer, go to the Individual Components tab, type python in the search box and select the Python components. This will add the necessary support for working with Python. AFAIK you don't need any additional VS extensions for basic Python support. If you installed additional extensions then ensure they don't get in the way.

    If you want to be able to call Python in your .NET (winforms) app then you'll need a third party library that adds support for Python in .NET. IronPython used to be the way to go but I don't know anymore. PythonNet seems like a more recent solution. It does support "loading" NET into Python but I suspect you're going to find it limiting. Also note that VS doesn't provide support for any of this so you'll access to features like WYSIWYG editing of the UX, etc.

    In general I would recommend that you use the best language for each task. Since UX stuff is easier in C# then build your Winforms app in C#. If you have existing code in Python that implements functionality then have your C# app call the Python logic to perform the actual work of the app and leave the UX functionality in C#. But that is just my opinion.


Your answer

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