visual studio – In VB.Net how to reset VB source to Form source?


I migrated a VB.net Winforms application from .Net Framework 4.8 to .Net 9.0.

enter image description here

After automatic migration using Visual Studio 2022 only one VB source is displayed as Form (it is possible to display it on Visual Studio Designer). (see icon before EditBox.Home.vb in red circle).

All other VB sources are prefixed with VB in blueicon (see VB in blue circle). When I click on these sources, Visual Studio Designer is displaying their source !

How can I revert these sources so that a Form is displayed when I click on it ?

The sources of first EditBox.Home.vb that is correctly displayed is

EditBox.Home.vb

Public Class EditBoxHomePanel
    Inherits System.Windows.Forms.UserControl
End Class

EditBox.Home.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class EditBoxHomePanel
    Inherits System.Windows.Forms.UserControl

    <System.Diagnostics.DebuggerNonUserCode()>
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    Private components As System.ComponentModel.IContainer

    <System.Diagnostics.DebuggerStepThrough()>
    Private Sub InitializeComponent()
        ....

The sources of EditBoxControls.vb are SAME except name of sources !

What is happening ?

I added a new Form and also a new UserControl but both controls are never displayed in Designer.

Leave a Reply

Your email address will not be published. Required fields are marked *