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

Simulating IntelliSense's parameter list for a function call (like MsgBox Button)

GGoldenborne
Happy Friday, y'all!

I am creating a function and want to have IntelliSense pop down the list of valid options for a certain parameter in the same way that the MsgBox function behaves when you are typing your argument for which buttons you wish to include (such as MsgBoxStyle.OkCancel). I have done my best to search the internet but haven't found a thing which comes close to what I'm seeking. My monkeying around hasn't produced a satisfactory solution, yet, either.

A related additional thing, which I can live without but that would be nice to have, is the description of the current parameter, which appears below the function description as shown highlighted below

MsgBox (Prompt As Object, [Buttons as Microsoft.Visual Basic.MsgBoxStyle = MsgBoxStyle .DefaultButton1], [Title as Object = Nothing]) As Microsoft.VisualBasic.MsgBoxResult
Buttons:
Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to user, the identity of the default button, and the modality of the message box. If you omit Buttons, the default is zero.
This is my first post. I'm relatively new to VB .Net. I appreciate your assistance. :)
Jan 29 '10 #1

✓ answered by tlhintoq

You don't have to 'simulate' this. That information comes from the attributes and smart comments you assign to a parameter.

Expand|Select|Wrap|Line Numbers
  1.         /// <summary>
  2.         /// Max number of times checking the dongle can fail before quitting the app
  3.         /// </summary>
  4.         [Description("Maximum number of failures before we throw a failure event. Must be > 0"),
  5.         Category("Custom"),
  6.         DefaultValue(10),
  7.         Browsable(true)]
  8.         public int MaxFailures
  9.         {
  10.             get
  11.             {
  12.                 return maxFail;
  13.             }
  14.             set
  15.             {
  16.                 if (value > 0) maxFail = value;
  17.             }
  18.         }
  19.  
XML comments in the /// will show up in Intelesense hothelp
Attributes in the [ ] will show up in designer properties remark area.

I suggest you try it this way.
First build the complete property or method. Then go one line above it and type ///
Intelesense will then stub in XML tags for description, parameters and return. All you have to do is complete the descriptions.

You can define your own attributes, or use the stock ones like 'Description'.
http://msdn.microsoft.com/en-us/libr...attribute.aspx

5 3839
tlhintoq
3,525 Expert 2GB
You don't have to 'simulate' this. That information comes from the attributes and smart comments you assign to a parameter.

Expand|Select|Wrap|Line Numbers
  1.         /// <summary>
  2.         /// Max number of times checking the dongle can fail before quitting the app
  3.         /// </summary>
  4.         [Description("Maximum number of failures before we throw a failure event. Must be > 0"),
  5.         Category("Custom"),
  6.         DefaultValue(10),
  7.         Browsable(true)]
  8.         public int MaxFailures
  9.         {
  10.             get
  11.             {
  12.                 return maxFail;
  13.             }
  14.             set
  15.             {
  16.                 if (value > 0) maxFail = value;
  17.             }
  18.         }
  19.  
XML comments in the /// will show up in Intelesense hothelp
Attributes in the [ ] will show up in designer properties remark area.

I suggest you try it this way.
First build the complete property or method. Then go one line above it and type ///
Intelesense will then stub in XML tags for description, parameters and return. All you have to do is complete the descriptions.

You can define your own attributes, or use the stock ones like 'Description'.
http://msdn.microsoft.com/en-us/libr...attribute.aspx
Jan 29 '10 #2
Thanks for the help! I'm on the right track now. (I'm just working out the differences a little from your example which is some flavor of C, I think, to VB.) I really appreciate it. You've made my day!
Jan 29 '10 #3
GGoldenborne:
Can you show me how to do it, I still don't get it?
I don't understand the C example :-(

:-)
Jun 13 '10 #4
Arghhhh, GOT IT!

For others: You make XML comments in vb.net using '''

Example:
''' <summary>
''' This is a test comment
''' </summary>
''' <param name="Str1">Type in some text</param>
''' <param name="Str2">Type in some more text</param>
''' <returns></returns>
''' <remarks></remarks>
Function TEST(ByVal Str1 As String, ByVal Str2 As String) As String
Return Str1 And Str2
End Function
Jun 13 '10 #5
That's exactly correct, BeeBob12! Good work. :-)
Jun 14 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: peter | last post by:
Hi all, In VB.net,using Type.InvokeMember to call a method of a class in COM dll,the method has a reference parameter,It seems that there is no way to return the changed value of that...
3
by: carl.barrett | last post by:
Hi, I have a number of buttons on a form which run mailmerges. Next to each button is a text box/control that the user enters a date into when the letter was created/merged. When the user...
3
by: Doug Eleveld | last post by:
Hi Everyone, I have been playing aroung with 'object-oriented' C for a while now and I have come up with an interesting way to simulate C++ inheritance and non-member functions in C in a 100%...
2
by: msnews.microsoft.com | last post by:
How do I get Intellisense to open a dropdown list box for a method's parameters when the parameter is an ENUM? public class MyClass { public enum IDkind { PersonID, EntityID, PlaceID
5
by: YR | last post by:
Hello, I am tasked to write an application for a travel agency, that should be able to get a price for airline tickets from airline's website. Generally, airlines don't provide any web services...
11
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to...
3
by: Rick Palmer | last post by:
Hello all, I have a function I have written that gets Invoices by a date range. It looks something like this: GetInvoicesbyDateRange(ByVal LBound as Date, ByVal UBound as Date, ByVal...
1
by: R Hedges | last post by:
Hi there-I'm an AMATEUR VB.NET programmer, who has hacked together a small VB.NET application that can get information from remote machines using the System.Management namespace. MY APPLICATION...
8
by: dancole42 | last post by:
I have a form called CustomerLookup. It displays a DataSheet of all our customers so that someone can quickly and easily view all our customers. When someone double clicks on one of the...
1
by: eBob.com | last post by:
I have some code which is trying to determine where text will wrap in a custom text box (which Inherits from Control). It determines the number of characters which will fit in the first line, but...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.