Question about errors in Swimsuit Calculator project

I just converted a second project to VB 2005 EE format from VB 6 called "Ami Mizuno's Swimsuit Calculator!" and there were 2 errors in it which are the following:

==================================================================

Error 1 'Public Event Load(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event. C:\Visual Basic Projects\Ami Swimsuit Calculator\Ami_Swimsuit_Calculator.NET\Form1.vb 9 3 Ami_Swimsuit_Calculator

This is found in Form1.vb, Line 9, Column 3. I managed to fix this error by adding a RaiseEvent statement thanks to the correction option that was available.

Unfortunately it's now brought up the following error:

Error 1 Derived classes cannot raise base class events. C:\Visual Basic Projects\Ami Swimsuit Calculator\Ami_Swimsuit_Calculator.NET\Form1.vb 9 20 Ami_Swimsuit_Calculator

This is found in the same form and the same line but Column 20 instead which is in the following code:

RaiseEvent Load(frmSplash) [the word Load having a blue squiggle line underneath it] and this seems to have to do with the second error...

As for the second error, this should be easy to fix but I don't know how to declare it...

Error 2 Name 'Load' is not declared. C:\Visual Basic Projects\Ami Swimsuit Calculator\Ami_Swimsuit_Calculator.NET\Module1_Splash.vb 7 3 Ami_Swimsuit_Calculator

This is found in Module1_Splash.vb, Line 7, Column 9 with the code being the following:

Load(frmSplash)

With this particular error, I tried to see if there was a Smart Tag for it but there didn't seem to be even though there was a blue squiggle line underneath the Load part of the code and as a result, I can't auto-correct it...

If anyone has any suggestions, please let me know as I'd like to be able to make my calculator available for download so I can get some comments on it plus learn from the errors in the code...



Answer this question

Question about errors in Swimsuit Calculator project

  • omer khan sahab

    This is the full code from Form1.vb...

    Option Strict Off

    Option Explicit On

    Friend Class Form1

    Inherits System.Windows.Forms.Form

    Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

    Left = VB6.TwipsToPixelsX((VB6.PixelsToTwipsX(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width) - VB6.PixelsToTwipsX(Width)) \ 2)

    Top = VB6.TwipsToPixelsY((VB6.PixelsToTwipsY(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) - VB6.PixelsToTwipsY(Height)) \ 2)

    'UPGRADE_ISSUE: Load statement is not supported. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm keyword="B530EFF2-3132-48F8-B8BC-D88AF543D321"'

    RaiseEvent Load(frmSplash)

    frmSplash.Show()

    End Sub

    Public Sub mnuAbout_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles mnuAbout.Click

    Call MsgBox("'Ami Mizuno's Swimsuit Calculator!' was created on the 4th of April by Jason Kinnison-Holmes (RuneJayce@Yahoo.com) and is the second calculator that he's created. If you have any comments about this calculator, please e-mail me! ^_^", MsgBoxStyle.Information, "Ami Mizuno's Swimsuit Calculator!")

    End Sub

    Public Sub mnuExit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles mnuExit.Click

    Me.Close()

    End Sub

    End Class


    This is the code from the Module1_Splash.vb file:

    Option Strict Off

    Option Explicit On

    Module Module1

    'UPGRADE_NOTE: main was upgraded to main_Renamed. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'

    Sub main_Renamed()

    'UPGRADE_ISSUE: Load statement is not supported. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm keyword="B530EFF2-3132-48F8-B8BC-D88AF543D321"'

    Load(frmSplash)

    frmSplash.Show()

    End Sub

    End Module


    This is the code from the frmSplash.vb file:

    Option Strict Off

    Option Explicit On

    Friend Class frmSplash

    Inherits System.Windows.Forms.Form

    Private Sub frmSplash_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress

    Dim KeyAscii As Short = Asc(eventArgs.KeyChar)

    Me.Close()

    eventArgs.KeyChar = Chr(KeyAscii)

    If KeyAscii = 0 Then

    eventArgs.Handled = True

    End If

    End Sub

    Private Sub frmSplash_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

    lblVersion.Text = "Version " & My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Revision

    lblProductName.Text = My.Application.Info.Title

    End Sub

    'UPGRADE_ISSUE: Frame event Frame1.Click was not upgraded. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm keyword="ABD9AF39-7E24-4AFF-AD8D-3675C1AA3054"'

    Private Sub Frame1_Click()

    Me.Close()

    End Sub

    End Class


    From the looks of things, I'd say that the main code converted fine and as previously mentioned, I managed to change one piece of code in the main form and the errors all seem to have to do with the splash screen...


  • Dr. GV

    No, you dont need to do any coding at all.

    You create you splash screen using the splash screen dialog.

    Then if you go to My Project, you will see you can simply select one of you forms to be the splash screen. Thats it.....


  • IamLost

    hi,

    would you plz post part of your code along with those error messages

    best regards



  • Artmic

    hi,

    Is your problem solved

    Thank you,
    Bhanu.



  • Jim Beachy

    As all of these errors from first appearance appear to be related to the splash screen. My advice on this would be...

    Remove the form and code related to the old way you were creating and manipulating a splash screen.

    Add a new Splash screen form (which is a standard item which you can add to a project). Modify the form layout to make it how you want it to appear - you can put your own graphics and stuff on this form.

    Goto Project Properties and Point the spalsh screen form setting to your newly created splash screen form.

    And then you have your splash screen working in a standard manner for VB applications with virtually no coding to make the splash screen work when you start your application.


  • teemuh

    The splash screen is not a special thing: it's the same as any other form. Edit it as you would edit (design) any other form in your project.

    The borderstyle of the splash screen has been set to none: if you right-click on it you can select the underlying form, or change the size in the properties list.

    If you accidentally deleted all the stuff on the splash screen when you added it, add another one and look at the code for the form - it shows you how it displays the version number, application name, etc.



  • Seadap05

    I'll give it a try tomorrow and see how it goes... Obviously I place the new Splash Screen code in the same spot as the old Splash Screen code


  • Nitstheone

    I'll give it a try using the picturebox option and see if that works because I don't want to have to go through all the hassle of resizing the picture that I want to use just so that it will fit a splash screen...

    Thanks for the advice, SJ...:)


  • RyanLeeSchneider

    I've created a new splash screen and changed the background color and kind of added an image in the form of an background image which I can't resize even though it just about fits the regular size of a splash screen after I switched off the tiling option but now I can't add any text to the splash screen for information like the program's name, who it's copyrighted to, what version it is, etc.

    Can anybody point me as to how I should edit the splash screen to add text to it...


  • Mjemitchell

    hi,

    i think you have to remove this line "RaiseEvent Load(frmSplash)" and try

    if it didn't work try what spotty said

    hope this helps



  • Gita Shingala

    I did a test splash screen with a piece of artwork and I was curious if I can resize it using resizing handles like you can with clipart in Microsoft Word as well as move it about or does it have to be in a particular position
  • walan

    You could put the picture anywhere you like at any size you like. If you place it on a form (as the form background) you can tile, center or stretch the image. If you put it in a picturebox, you can do the same and place it, resize it to anywhere on the form.



  • Question about errors in Swimsuit Calculator project