473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

microsoft.public.dotnet.languages.vb.data,microsof t.public.dotnet.languages.vb.controls,microsoft.pu blic .dotnet.languages.vb,microsoft.public.dotnet.langu ages.vb.upgrade

Dear newsgroup - do not reply to this e-mail address. I have just
created it to avoid getting spam to my real address. Reply to the
newsgroup. I am watching them all now so please reply now.
How do I get a list of methods that my class supports? Here is my
code.
I want

MsgBox(a.GetMethods, MsgBoxStyle.Information Or MsgBoxStyle.OKOnly,
a.GetVersion)

to display, if a is a "TanOperations", "getTan1, getTan2". If a is a
"SinOperations", "getSin" etc.

To help you I am using Visual Studio .net 2003.

Thank you
Gladys

Imports System.Math

Public Class Form1
Inherits System.Windows.Forms.Form

Private MustInherit Class Trigonometry
Public Shared Function GetVersion() As String
Return "V1.0.1"
End Function

Public Function GetMethods() As String()
'WHAT CODE GOES IN HERE??
'=========================

End Function
End Class

Private Class TanOperations
Inherits Trigonometry
Public Function getTan1(ByVal opp As Double, ByVal adj As
Double) As Double
Return Tan(opp / adj)
End Function

Public Function getTan2(ByVal theta As Double) As Double
Return Tan(theta)
End Function
End Class

Private Class SinOperations
Inherits Trigonometry
Public Function getSin(ByVal opp As Double, ByVal hypot As
Double) As Double
Return Sin(opp / hypot)
End Function
End Class

'windows form designer code deleted to save posting space
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim a As New TanOperations
MsgBox(a.getTan(10, 20), MsgBoxStyle.Information Or
MsgBoxStyle.OKOnly, a.GetVersion)
MsgBox(a.GetMethods, MsgBoxStyle.Information Or
MsgBoxStyle.OKOnly, a.GetVersion)
End Sub
End Class
Nov 20 '05 #1
3 1322
You can use reflection:

Dim t As Type = GetType(MyClass)
For Each methodInfo As System.Reflection.MethodInfo _
In t.GetMethods
MsgBox(methodInfo.Name)
Next
--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Gladys" <gl***********@hotmail.com> schreef in bericht
news:67**************************@posting.google.c om...
Dear newsgroup - do not reply to this e-mail address. I have just
created it to avoid getting spam to my real address. Reply to the
newsgroup. I am watching them all now so please reply now.
How do I get a list of methods that my class supports? Here is my
code.
I want

MsgBox(a.GetMethods, MsgBoxStyle.Information Or MsgBoxStyle.OKOnly,
a.GetVersion)

to display, if a is a "TanOperations", "getTan1, getTan2". If a is a
"SinOperations", "getSin" etc.

To help you I am using Visual Studio .net 2003.

Thank you
Gladys

Imports System.Math

Public Class Form1
Inherits System.Windows.Forms.Form

Private MustInherit Class Trigonometry
Public Shared Function GetVersion() As String
Return "V1.0.1"
End Function

Public Function GetMethods() As String()
'WHAT CODE GOES IN HERE??
'=========================

End Function
End Class

Private Class TanOperations
Inherits Trigonometry
Public Function getTan1(ByVal opp As Double, ByVal adj As
Double) As Double
Return Tan(opp / adj)
End Function

Public Function getTan2(ByVal theta As Double) As Double
Return Tan(theta)
End Function
End Class

Private Class SinOperations
Inherits Trigonometry
Public Function getSin(ByVal opp As Double, ByVal hypot As
Double) As Double
Return Sin(opp / hypot)
End Function
End Class

'windows form designer code deleted to save posting space
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim a As New TanOperations
MsgBox(a.getTan(10, 20), MsgBoxStyle.Information Or
MsgBoxStyle.OKOnly, a.GetVersion)
MsgBox(a.GetMethods, MsgBoxStyle.Information Or
MsgBoxStyle.OKOnly, a.GetVersion)
End Sub
End Class

Nov 20 '05 #2
Jan's method is very good. As an FYI, you can also use GetMembers and get
additional information about properties events etc.

http://www.knowdotnet.com/articles/reflection.html
"Gladys" <gl***********@hotmail.com> wrote in message
news:67**************************@posting.google.c om...
Dear newsgroup - do not reply to this e-mail address. I have just
created it to avoid getting spam to my real address. Reply to the
newsgroup. I am watching them all now so please reply now.
How do I get a list of methods that my class supports? Here is my
code.
I want

MsgBox(a.GetMethods, MsgBoxStyle.Information Or MsgBoxStyle.OKOnly,
a.GetVersion)

to display, if a is a "TanOperations", "getTan1, getTan2". If a is a
"SinOperations", "getSin" etc.

To help you I am using Visual Studio .net 2003.

Thank you
Gladys

Imports System.Math

Public Class Form1
Inherits System.Windows.Forms.Form

Private MustInherit Class Trigonometry
Public Shared Function GetVersion() As String
Return "V1.0.1"
End Function

Public Function GetMethods() As String()
'WHAT CODE GOES IN HERE??
'=========================

End Function
End Class

Private Class TanOperations
Inherits Trigonometry
Public Function getTan1(ByVal opp As Double, ByVal adj As
Double) As Double
Return Tan(opp / adj)
End Function

Public Function getTan2(ByVal theta As Double) As Double
Return Tan(theta)
End Function
End Class

Private Class SinOperations
Inherits Trigonometry
Public Function getSin(ByVal opp As Double, ByVal hypot As
Double) As Double
Return Sin(opp / hypot)
End Function
End Class

'windows form designer code deleted to save posting space
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim a As New TanOperations
MsgBox(a.getTan(10, 20), MsgBoxStyle.Information Or
MsgBoxStyle.OKOnly, a.GetVersion)
MsgBox(a.GetMethods, MsgBoxStyle.Information Or
MsgBoxStyle.OKOnly, a.GetVersion)
End Sub
End Class

Nov 20 '05 #3
* gl***********@hotmail.com (Gladys) scripsit:
[...]

Are you sure you understood the meaning of the "Subject:" line?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: chausan | last post by:
Update ++++++ All attchment scanned with norton anti-virus w/ yahoo mail service and they all reported infected with virus Worm.Automat.AHB. ======================================== From:...
5
by: Fabrizio | last post by:
HI, How i can use the Microsoft.Web.UI.WebControls reference inside a web project? There is any DLL to add? Thank you, Fabrizio
86
by: Michael Adams | last post by:
I don't know if you have noticed, but it seems like Microsoft is losing interest in C#, and putting their energy into Visual Basic.NET instead. For instance, online chats by language since July...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
9
by: Mark | last post by:
Hello I am trying to set up an open file routine that will open whatever files name is passed with its correct associated application. I have done this (quite easilly) before in VBA and am able...
2
by: Tay Kai Yang | last post by:
Hi Sincerely wanting to know how to subscribe to microsoft.public.dotnet.language.csharp. I have contacted my ISP regarding the problem that I cannot access...
38
by: kavsak | last post by:
Hi. Not sure that this is the right place to ask but here goes. I have an application based on access97 and VB6 which I need to upgrade. It has to handle up to 20 concurrent users on a Win2k...
23
by: =?Utf-8?B?TWlrZTE5NDI=?= | last post by:
This is an example that is supposed to work in VB http://support.microsoft.com/kb/175512/en-us After spending a couple of hours downloading and installing VB Express 2008 after someone told me it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.