473,388 Members | 1,390 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,388 software developers and data experts.

triger intellesence for functions

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
Nov 20 '05 #1
4 1117
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

"T Perkins" <sl******@hotmail.com> wrote in message
news:OH****************@TK2MSFTNGP11.phx.gbl...
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

Nov 20 '05 #2
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" <sl******@hotmail.com> wrote in message
news:OH****************@TK2MSFTNGP11.phx.gbl...
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

Nov 20 '05 #3
thats exactly what im look for. it works great.... thanks
Nov 20 '05 #4
* "T Perkins" <sl******@hotmail.com> scripsit:
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)
Nov 20 '05 #5

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

Similar topics

5
by: hokiegal99 | last post by:
A few questions about the following code. How would I "wrap" this in a function, and do I need to? Also, how can I make the code smart enough to realize that when a file has 2 or more bad...
99
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less...
1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
47
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
21
by: Rubén Campos | last post by:
I haven't found any previous message related to what I'm going to ask here, but accept my anticipated excuses if I'm wrong. I want to ask about the real usefulness of the 'inline' keyword. I've...
25
by: Stijn Oude Brunink | last post by:
Hello, I have the following trade off to make: A base class with 2 virtual functions would be realy helpfull for the problem I'm working on. Still though the functions that my program will use...
2
by: Koen | last post by:
Hi all, I have a question about something rather common, but I'm a bit lost at the moment: Lat's say you have this: // in A.h Class A {
2
by: Jerry C | last post by:
I am not getting intellesence in web.config any ideas. Visual Studio 2005, framework 2 , visual basic Thank you -- Jerry
7
by: Immortal Nephi | last post by:
My project grows large when I put too many member functions into one class. The header file and source code file will have approximately 50,000 lines when one class contains thousand member...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.