Rename a form in Visual Studio 2022

Steev43230 5 Reputation points
2023-03-27T21:23:08.4866667+00:00

Hello, trying to rename a form. The guidance here appears to still be good but even though I renamed the form in solution explorer, told VS2022 to rename it everywhere, and set the startup object in project properties, I still get the error, "BC30456 - Form1 is not a member of WinFormsApp3." How do I fix this?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,874 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Jiachen Li-MSFT 29,261 Reputation points Microsoft Vendor
    2023-03-28T02:10:20.1633333+00:00

    Hi @Steev43230 , welcome to MicrosoftQ&A.

    Please open Application.Designer.vb file in solution explorer. If you cannot find it, cleck Show All File button.

    User's image

    Replace the Form1. in the following code with the modified name. enter image description here

    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

  2. J Wilson 0 Reputation points
    2023-05-21T21:21:18.8+00:00

    Try this, in your Solution Explorer right click on the Form1.vb file.

    Screenshot 2023-05-21 171336

    In the drop down select Rename and change the name to what you want it to be. A message box will appear and ask of you want to change all references in your project, select yes.

    Screenshot 2023-05-21 171503

    Hope this answers your question.

    Good Luck


  3. Tuấn Anh 0 Reputation points
    2024-05-27T23:01:11.3866667+00:00

    i did it, i choose yes and then it's still have some problems with properties

    0 comments No comments