Click here to Skip to main content
15,922,007 members
Home / Discussions / C#
   

C#

 
AnswerRe: Adding days to a column in a rowfilter Pin
KaptinKrunch17-Nov-05 14:12
KaptinKrunch17-Nov-05 14:12 
Questioncall code from string? Pin
Codegreen_71317-Nov-05 13:51
Codegreen_71317-Nov-05 13:51 
AnswerRe: call code from string? Pin
KaptinKrunch17-Nov-05 14:10
KaptinKrunch17-Nov-05 14:10 
GeneralRe: call code from string? Pin
Codegreen_71317-Nov-05 15:11
Codegreen_71317-Nov-05 15:11 
GeneralRe: call code from string? Pin
lmoelleb17-Nov-05 22:51
lmoelleb17-Nov-05 22:51 
GeneralRe: call code from string? Pin
Judah Gabriel Himango18-Nov-05 5:52
sponsorJudah Gabriel Himango18-Nov-05 5:52 
GeneralRe: call code from string? Pin
Codegreen_71318-Nov-05 11:35
Codegreen_71318-Nov-05 11:35 
AnswerRe: call code from string? Pin
vineas18-Nov-05 12:53
vineas18-Nov-05 12:53 
It can be done using reflection, but it is probably a little slow, so use it sparingly:

<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
	Test("CLLER");<br />
	Test("Bob");<br />
}<br />
private void Test(string t)<br />
{<br />
	//t should be the sub i want to call! so how would i do this?<br />
	GetType().InvokeMember(t, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.InvokeMethod, null, this,  new object[] {"Test"});<br />
}<br />
private void CLLER(string T)<br />
{<br />
	MessageBox.Show(T);<br />
}<br />
private void Bob(string T)<br />
{<br />
	this.Text = T;<br />
}<br />
}<br />


Check out the documentation for InvokeMember, for more information.

-----
In the land of the blind, the one eyed man is king.
Questionunable to load unmanaged dll Pin
Mark Hahn CA17-Nov-05 13:39
Mark Hahn CA17-Nov-05 13:39 
QuestionC# 2 Document Compiler Pin
Fernando A. Gomez F.17-Nov-05 13:35
Fernando A. Gomez F.17-Nov-05 13:35 
QuestionADAM (Active Directory Application Mode) and C# Pin
sam31517-Nov-05 13:24
sam31517-Nov-05 13:24 
AnswerRe: ADAM and C# Pin
Dave Kreskowiak17-Nov-05 14:24
mveDave Kreskowiak17-Nov-05 14:24 
GeneralRe: ADAM and C# Pin
sam31517-Nov-05 16:47
sam31517-Nov-05 16:47 
GeneralRe: ADAM and C# Pin
Dave Kreskowiak18-Nov-05 6:41
mveDave Kreskowiak18-Nov-05 6:41 
QuestionScope problem Pin
Dan Neely17-Nov-05 9:51
Dan Neely17-Nov-05 9:51 
AnswerRe: Scope problem Pin
Trevor McClean17-Nov-05 10:27
Trevor McClean17-Nov-05 10:27 
AnswerRe: Scope problem Pin
Christian Graus17-Nov-05 11:20
protectorChristian Graus17-Nov-05 11:20 
GeneralRe: Scope problem Pin
User 665817-Nov-05 12:22
User 665817-Nov-05 12:22 
GeneralRe: Scope problem Pin
Dave Kreskowiak17-Nov-05 14:18
mveDave Kreskowiak17-Nov-05 14:18 
GeneralRe: Scope problem Pin
Judah Gabriel Himango17-Nov-05 15:34
sponsorJudah Gabriel Himango17-Nov-05 15:34 
GeneralRe: Scope problem Pin
Christian Graus17-Nov-05 15:36
protectorChristian Graus17-Nov-05 15:36 
GeneralRe: Scope problem Pin
User 665817-Nov-05 20:40
User 665817-Nov-05 20:40 
QuestionMulti Threading Pin
zaboboa17-Nov-05 5:26
zaboboa17-Nov-05 5:26 
AnswerRe: Multi Threading Pin
Mark Hahn CA17-Nov-05 13:44
Mark Hahn CA17-Nov-05 13:44 
Questionicon overlay handler Pin
rakesh_nits17-Nov-05 3:05
rakesh_nits17-Nov-05 3:05 

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.