Click here to Skip to main content
15,891,473 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: DateTimePicker - VB Pin
Anoop Brijmohun14-Mar-08 0:54
Anoop Brijmohun14-Mar-08 0:54 
GeneralRe: DateTimePicker - VB Pin
AshokPatra14-Mar-08 1:24
AshokPatra14-Mar-08 1:24 
GeneralRe: DateTimePicker - VB Pin
akash_omsairam14-Mar-08 7:33
akash_omsairam14-Mar-08 7:33 
GeneralRe: DateTimePicker - VB Pin
Dave Kreskowiak14-Mar-08 7:56
mveDave Kreskowiak14-Mar-08 7:56 
GeneralRe: DateTimePicker - VB Pin
Mycroft Holmes15-Mar-08 22:02
professionalMycroft Holmes15-Mar-08 22:02 
QuestionHow to Call Function of vb.net whose name stored in Database? Pin
Guru_yogi14-Mar-08 0:09
Guru_yogi14-Mar-08 0:09 
AnswerRe: How to Call Function of vb.net whose name stored in Database? Pin
Colin Angus Mackay14-Mar-08 1:08
Colin Angus Mackay14-Mar-08 1:08 
AnswerRe: How to Call Function of vb.net whose name stored in Database? Pin
AshokPatra14-Mar-08 2:16
AshokPatra14-Mar-08 2:16 
You can create a database table storing something like:
menuname functionname
open openfunction
new newfunction

We can easily retrieved the function name from the database for the menu clicked.

After the function name is received by us, we have to use Reflection.

I am giving a code sample like this:
Sopposing I have a class where the functions are available

<b>Public Class Class1

Public Sub openfunction()
MsgBox("This is open function")
End Sub

End Class</b>

Then I have a button on the form, I want to call the function using reflection.
You have to import System.Reflection namespace

the code goes like this:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim t As Type = GetType(Class1)

Dim o As Object = Activator.CreateInstance(t)

Dim mi As MethodInfo = t.GetMethod("openfunction")
' U can write the variable which store the methor name in place of openfunction
mi.Invoke(o, Nothing)
End Sub

The code will slightly change when we will be using any reference assembly or resolving the assemblies at runtime.

Hope the solution is OK for you.
AnswerRe: How to Call Function of vb.net whose name stored in Database? Pin
akash_omsairam14-Mar-08 8:06
akash_omsairam14-Mar-08 8:06 
GeneralRe: How to Call Function of vb.net whose name stored in Database? Pin
Dave Kreskowiak14-Mar-08 9:06
mveDave Kreskowiak14-Mar-08 9:06 
GeneralPopulate ComboBox Using BackGroundWorker... Pin
Member 364986413-Mar-08 23:42
Member 364986413-Mar-08 23:42 
AnswerRe: Populate ComboBox Using BackGroundWorker... Pin
Chinners14-Mar-08 0:57
Chinners14-Mar-08 0:57 
QuestionRadnom pick from a enumeration? Pin
Benny_Lava13-Mar-08 20:33
Benny_Lava13-Mar-08 20:33 
GeneralRe: Radnom pick from a enumeration? Pin
darkelv13-Mar-08 21:39
darkelv13-Mar-08 21:39 
GeneralMulti pages in a single crystal report in vb.net Pin
r_mohd13-Mar-08 19:49
r_mohd13-Mar-08 19:49 
GeneralRe: Multi pages in a single crystal report in vb.net Pin
Dave Kreskowiak14-Mar-08 8:16
mveDave Kreskowiak14-Mar-08 8:16 
GeneralRe: Multi pages in a single crystal report in vb.net Pin
r_mohd14-Mar-08 23:12
r_mohd14-Mar-08 23:12 
GeneralRe: Multi pages in a single crystal report in vb.net Pin
Mycroft Holmes15-Mar-08 22:07
professionalMycroft Holmes15-Mar-08 22:07 
Questionhow to show LONG column in datagrid vb.net Pin
jomet13-Mar-08 19:18
jomet13-Mar-08 19:18 
AnswerRe: how to show LONG column in datagrid vb.net Pin
jomet13-Mar-08 23:26
jomet13-Mar-08 23:26 
Generalplotting in Visual Basics Pin
Orlando234513-Mar-08 18:00
Orlando234513-Mar-08 18:00 
GeneralRe: plotting in Visual Basics Pin
Dave Kreskowiak14-Mar-08 8:04
mveDave Kreskowiak14-Mar-08 8:04 
GeneralRe: plotting in Visual Basics Pin
Orlando234516-Mar-08 9:17
Orlando234516-Mar-08 9:17 
GeneralRe: plotting in Visual Basics Pin
Dave Kreskowiak16-Mar-08 16:42
mveDave Kreskowiak16-Mar-08 16:42 
GeneralTimer Pin
Ahmad Rifai Yusuf13-Mar-08 17:33
Ahmad Rifai Yusuf13-Mar-08 17:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.