Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual basic error BC30456 'Form1' is not a member of 'WindowsApplication1'

Tags:

vb.net

Hello I am trying to do an exercise and keep getting this error when compiling.

Visual Basic error BC30456 'Form1' is not a member of 'WindowsApplication1'

I'm not sure how to fix it.

Below is my code:

Public Class frmCentsConverter
    Private Sub txtAmount_TextChanged(sender As Object, e As EventArgs) Handles txtAmount.TextChanged
        If IsNumeric(txtAmount.Text) Then
            Dim NumberofCents As Integer

            NumberofCents = CInt(txtAmount.Text)
            lblDollars.Text = CStr(NumberofCents \ 100)
            lblCents.Text = CStr(NumberofCents Mod 100)
        End If
    End Sub

    Private Sub lblTitle_Click(sender As Object, e As EventArgs) Handles lblTitle.Click

    End Sub
End Class
like image 455
Oscar Kasil Avatar asked Aug 17 '15 09:08

Oscar Kasil


People also ask

How do I fix error bc30456?

If you get this problem, open the error message by clicking the error line until Application. Designer. vb shows up & then find the "Form1" name in that place. I found the "Form1" name in that part of code, just replace that "Form1" with the name of your form.

How do I open an Application designer in Visual Basic?

To access the Application page, choose a project node (not the Solution node) in Solution Explorer. Then choose Project > Properties on the menu bar. When the Project Designer appears, select the Application tab.

Is not declared it may be inaccessible due to its protection level?

It may be inaccessible due to its protection level" error occurs when you declare a private method or property. As a result, you cannot access them. Please add the Protected or Public access level (see Access Levels in Visual Basic) to your "GetTitle" method's declaration and let me know your results.


2 Answers

If you have renamed the startup form1 it is likely you also have to change the Startup form setting. You can find this setting to open 'My Project' in the 'Solution Explorer'. Select the Application section, change the 'startup form' as appropriate.

Hope this will help, Harrie

like image 136
Harrie Avatar answered Oct 17 '22 14:10

Harrie


To set the startup form in Windows Forms

  1. In Solution Explorer, right-click the project and choose Properties.
  2. The Project property page opens with the Application properties displayed.
  3. Choose the form you want as the startup form from the Startup Object drop-down list.

I got this information from this website:

https://msdn.microsoft.com/library/a2whfskf(v=vs.100).aspx

I can confirm this works on Visual Studio 2015 as well.

like image 6
Caleb McGlothin Avatar answered Oct 17 '22 13:10

Caleb McGlothin