PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Caling my own function with 'VISUAL' parameters-VBForums
Results 1 to 4 of 4

Thread: Caling my own function with 'VISUAL' parameters

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Croatia
    Posts
    23

    Question Caling my own function with 'VISUAL' parameters

    This is my sample 'EMPTY' function..

    VB Code:
    1. Function Calculate(ByVal number1 As Decimal, ByVal number2 As Decimal, ByVal operation As String) As Decimal
    2.         'operation 'Divide'
    3.         'operation 'Multiply'
    4.  
    5.         'CODE
    6.  
    7. End Function

    So when trying to call this function the parameters "NUMBER1" & "NUMBER2" are decimal type, but when comes parameter
    "OPERATION" I want to "popup box" with my own "someware defined available parameters" to be displayed so I can select available parameter to run function (example 'Divide', 'Multiply').

    What I want is something like when calling "MessageBox", it display available "Buttons" & "Icons" in popup "Listbox"
    (example... MessageBoxButtons.OKCancel, MessageBoxButtons.YesNo, MessageBoxIcon.Question)

    What type should be parameter "OPERATION" so it can show me these options?

    Please help, I'm sure there is someone who can give me a tip, detailed!
    Attached Images Attached Images  

  2. #2
    Hyperactive Member Grunt's Avatar
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    499
    you need to create a form. Put a calculate button on it, and do all of the calculations on the button click event. A messagebox, wont do what you want.

  3. #3
    Lively Member
    Join Date
    Sep 2004
    Posts
    96
    It's a bad explanation of what he's looking for. But I get it.

    Intellisense is what he's looking for.

    You have to create an enumerated type, with all the options and values you want, then change the parameter type from string to that new enumerated type.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Croatia
    Posts
    23

    Thumbs up Thanks

    It is not bad explanation, it's my bad english!

    It works fine now,great!

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width