Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to use CallByName function in VB.NET

How to use CallByName function in VB.NET

Scheduled Pinned Locked Moved Visual Basic
csharptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bqdieu
    wrote on last edited by
    #1

    Please tell me how to use CallByName function in VB.NET. Thanks,

    D 1 Reply Last reply
    0
    • B bqdieu

      Please tell me how to use CallByName function in VB.NET. Thanks,

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      CallByName lets you call a Function or manipulate a Property on an object, such as a TextBox or other class:

      CallByName(TextBox1, "Text", CallType.Set, "New Text")
       
      CallByName(TextBox1, "Hide", CallType.Method)
       
      Dim col As New Collection()
      ' Store the string "Item One" in a collection by
      ' calling the Add method.
      CallByName(col, "Add", CallType.Method, "Item One")
      ' Retrieve the first entry from the collection using the
      ' Item property and display it using MsgBox().
      MsgBox(CallByName(col, "Item", CallType.Get, 1))

      The down side to using the CallByName function is that it is very slow. There is also no type checking of arguments, so handling errors properly becomes a bit of a pain. RageInTheMachine9532

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups