Results 1 to 3 of 3

Thread: [RESOLVED] Can i make line of codes to tag like dim?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2008
    Location
    >> ( ҉ )
    Posts
    413

    Resolved [RESOLVED] Can i make line of codes to tag like dim?

    I have whole list of code. If i press button1 then happens.

    [----------CODE HERE----------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]

    If i press enter then happens.

    [----------CODE HERE----------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]

    Can i make it smaller like.

    Code =
    [----------CODE HERE----------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]
    [--------ANOTHER LINE---------]

    If i press button1 then happens = Code

    If i press enter then happens = Code

    Thanks!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Can i make line of codes to tag like dim?

    You simply put the code in a method and then call that method from multiple places, e.g. a Button Click event handler and a KeyDown event handler. With Buttons specifically, another option is to put the code in the Button Click event handler and then call PerformClick on that Button elsewhere in code.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2008
    Location
    >> ( ҉ )
    Posts
    413

    Re: Can i make line of codes to tag like dim?

    Hmm. Thank you.

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