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
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.
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.
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.
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
To set the startup form in Windows Forms
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With