Solved

passing the name of a procedure via a variable

Posted on 2006-07-10
2
219 Views
Last Modified: 2010-04-23
what is the easiest way to perform something similar to:

****
Dim var1 as String
Call var1
****

to excecute procedure Proc1?
0
Comment
Question by:the_bachelor
2 Comments
 
LVL 2

Expert Comment

by:TheUnkind
ID: 17078172
try this one

dim proc2 as new proc1



0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 50 total points
ID: 17078240
Here's an example, using CallByName:

  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    CallByName(Me, "Test", CallType.Method, New Object() {})

  End Sub

  Public Sub Test()
    MessageBox.Show("Test")
  End Sub

Bob
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now