Results 1 to 7 of 7

Thread: HELP me, a silly question. A little problem with my function

Threaded View

  1. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: HELP me, a silly question. A little problem with my function

    It's close. Here are some things you might want to look at

    1. Functions return values. If your function does not need to return a value, recommend renaming it to Sub vs Function.

    2. Don't pass the Index, it is unnecessary if you are also passing the Textbox control itself. So your call might look like: Filtruj KeyAscii, Text1(0)
    :: Your function is asking for a textbox, the MyText is simply a pointer/reference to whichever textbox you pass. It does not need an index within your code. Whether you pass an indexed textbox or one that is not indexed, MyText will correctly reference the passed control.

    3. Since you will not need the Index, replace all MyText(Index) with just MyText

    Oh, and where do you call it.
    Call it from within your KeyPress event, renaming Text1 to whatever your actual textbox control is named... Filtruj KeyAscii, Text1(Index)
    Last edited by LaVolpe; Jan 27th, 2009 at 05:16 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

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



Click Here to Expand Forum to Full Width