• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

Overload visibility

I have "TestClass" with five overloads (see below). I also have "ChildClass":

Public Class ChildClass
    Inherits ClassTest

    'this version of overload includes four arguments: k, l, m,  and n
    Public Overloads Function FindProduct(ByVal k As Single, ByVal l As Single, _
                                                ByVal m As Single, ByVal n As Single) As Single
        Return K * l * n * m
    End Function

From a form, I cannot see the overloads from the base class.

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim c As New ChildClass
        MessageBox.Show((c.FindProduct(CDbl(TextBox1.Text), CDbl(TextBox2.Text))).ToString)
    End Sub
End Class

Q1: Is there a way for me to see the overloads from the base class (ClassTest)?

When I the code to "Dim c As New TestClass", c. intelisense shows the first overload and says +5 more overloads.

Q2: How can I access the 5 other overloads? I want to see what kind of signiture each has.

Thank you,
Public Class TestClass

    Private mFName As String
    'this is the original function
    Public Overloads Function FindProduct(ByVal n As Integer, ByVal m As Integer) As Integer
        Return n * m
    End Function

    'in this overload the data type for n is changed to single:
    Public Overloads Function FindProduct(ByVal n As Single, ByVal m As Integer) As Integer
        Return n * m
    End Function

    'same as above except the order of n and m
    Public Overloads Function FindProduct(ByVal m As Integer, ByVal n As Single) As Integer
        Return n * m
    End Function

    'here n and m are changed to double
    Public Overloads Function FindProduct(ByVal n As Double, ByVal m As Double) As Double
        Return n * m
    End Function

    'n and m as single
    Public Overloads Function FindProduct(ByVal n As Single, ByVal m As Single) As Single
        Return n * m
    End Function

    'here there are three arguemnts: l, n,  and m 
    Public Overloads Function FindProduct(ByVal l As Single, ByVal n As Single, ByVal m As Single) As Single
        Return l * n * m
    End Function

End Class

Open in new window

0
Mike Eghtebas
Asked:
Mike Eghtebas
  • 4
  • 2
1 Solution
 
lluddenCommented:
There should be a little drop down arrow next to the other overloads, or you can use the up/down arrows to scroll through them.
0
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
lludden,

I will try and get back to you. This was regarding question 2. Do you have any feedback on question 1?

thx,

Mike
0
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
Sorry, there is no drop down arrow. Also up/down arrow doesn't bring up the remaining 5 overloads.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
lluddenCommented:
You need to inherit Testclass not classtest.

If you just assign a variable to testclass, you can see all of the overloads in it
0
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
lludden,

Thanks, that answeres question 1.

do you know how can I see the other overloads?

Mike
0
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
I see, after I selected the routine name, the arwo up/down showed up.

thx
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now