triger intellesence for functions

  • Thread starter Thread starter T Perkins
  • Start date Start date
T

T Perkins

is there a way to have intellesence give a list of options for each
parameter of a newly create functions. an example would be, using
messagebox.show. after you put in the message and label, you have a list of
different type of button styles(MessageBoxButtons.OKCancel), then a list for
icon(MessageBoxIcon.Warning).

i am attempting to create a common function for programs to use at work. i
am thinking it would be easier for the other programmers to use these
functions if i could some how use intellesence to give a list of options
that they can choose from a list when its appropriate to do so

thanks in advance
tony
 
T Perkins,
When you define your function, define the parameter as an Enum.

Something like:

Public Enum CommonOptions
Option1
Option2
Option3
End Enum

Public Enum MoreCommonOptions
Option1
Option2
Option3
Option4
End Enum

Public Class Functions

Public Function Common(ByVal options As CommonOptions, _
ByVal moreOptions As MoreCommonOptions) As Integer

End Function

End Class

Notice that each enum can have the same values, however those values do not
mean the same thing.

Using the Flags attribute you can make the Enum 'multivalue'.

<Flags()> Public Enum AccessValues
Read = 1
Write = 2
Browse = 4
Delete = 8
End Enum

Then you can use Or to combine them:

Common(AccessValues.Read or AccessValues.Writer)

Hope this helps
Jay
 
Do like this:

Public Enum MyValues
Value1 = 1
Value2 = 2
End Enum

Public MyFunction(InputValue As MyValues)

End Function

Calling the function will give the user option betweel Value1 or Value2

Regards
Fredrik Melin
 
* "T Perkins said:
is there a way to have intellesence give a list of options for each
parameter of a newly create functions. an example would be, using
messagebox.show. after you put in the message and label, you have a list of
different type of button styles(MessageBoxButtons.OKCancel), then a list for
icon(MessageBoxIcon.Warning).

i am attempting to create a common function for programs to use at work. i
am thinking it would be easier for the other programmers to use these
functions if i could some how use intellesence to give a list of options
that they can choose from a list when its appropriate to do so

\\\
Public Enum MyEnum
Constant1
Constant2
Constant3
End Enum
..
..
..
Public Sub Foo(ByVal x As MyEnum)
 
Back
Top