Call a procedure in VS2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nerurmon
    New Member
    • Jan 2008
    • 13

    #1

    Call a procedure in VS2005

    Hi,

    I want to call a procedure like cmd_Add_Click which I used in VB6

    Call cmd_Add_Click


    What will be the command in VS2005 if I want to call same procedure?
    Please help me
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Is a procedure the same thing as a sub? I don't typically work in VB (I'm a C# junkie), so I'm not up on the lingo. But (if this is what you are asking) calling a sub/function in VB.NET is simple: (using your example)
    [code=vbnet]
    cmd_Add_Click()
    [/code]
    Or, if it has parameters:
    [code=vbnet]
    cmd_Add_Click(p aram1, param2)
    [/code]

    I hope this is what you are asking.

    Originally posted by nerurmon
    Hi,

    I want to call a procedure like cmd_Add_Click which I used in VB6

    Call cmd_Add_Click


    What will be the command in VS2005 if I want to call same procedure?
    Please help me

    Comment

    • CyberSoftHari
      Recognized Expert Contributor
      • Sep 2007
      • 488

      #3
      Originally posted by nerurmon
      Hi,
      I want to call a procedure like cmd_Add_Click which I used in VB6...
      In VS 2005 every event procedures are call with two parameters (i,e sender As Object and e As EventsArgs), in other hand VB 6 do not need this parameters to call event procedures.

      [CODE=vbnet]‘VS 2005
      Private Sub Cmd_Add_Click(s ender As Object, e As EventsArgs)
      ‘Procedure code here
      End Sub

      Private Sub SomeTextBox_Key Down(sender As Object, e As EventsArgs)
      ‘Procedure code here
      Cmd_Add_Click(s ender, e);
      End Sub[/CODE]

      Comment

      Working...