Reputation: 11
I'm having issues with VB.net.
I'm trying to make a file pumper for myself, but I'm not really having much luck with it. upon typing a whole line of code, I eventually stumble upon the error of "BC30205 End of statement expected". I know this error has been asked here before, but my code is different.. I guess...Thhe specific line that gives me an error is:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load rbtnMegaByte.Checked = True
Visual Studio recommends me to delete both "System" in the code and keep it as "Object" and "EventArgs" but upon listening to Visual Studio I still have the "End of statement expected" error.
I'm not really the best at this, so sorry if this is a really easy mistake.
Upvotes: 1
Views: 10427
Reputation: 27322
That one line of code:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load rbtnMegaByte.Checked = True
Should be two lines:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
rbtnMegaByte.Checked = True
I guess you have copied and pasted this from somewhere and it hasn't preserved the carriage returns?
You will also need End Sub
further down but I assume that you have that already? So your subroutine should look like this:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
rbtnMegaByte.Checked = True
'Any other code here
End Sub
Upvotes: 1
Reputation: 316
This error may raised if you forget to close any block, check your blocks i.e check end if for any if or check end sub for sub etc. it would be better if you share some more code of that module
Upvotes: 0