Solved

send data when calling methods

Posted on 2009-07-04
4
190 Views
Last Modified: 2012-05-07
hi all,

I need to send a string when calling another method - something similar to events (sender, e)

thanks

d.
0
Comment
Question by:ingprokop
  • 2
4 Comments
 
LVL 5

Expert Comment

by:iUsername
ID: 24776687
I have to admit I don't really understand the question.

Do you want to send a string as a parameter to another method ?!?!
0
 

Author Comment

by:ingprokop
ID: 24776693
exactly...
0
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24776895
What about:

// in your class

public void takeSomeString(string myString)

{

   // do something with the string

   System.Diagnostics.Debug.WriteLine(myString);

}
 

// in your form_load or whatever call it like this
 

takeSomeString("some string here");
 

// or like this:
 

string justAString = "hello world";

takeSomeString(justAString);

Open in new window

0
 

Author Comment

by:ingprokop
ID: 24777467
ah great, that's what I needed...
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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

22 Experts available now in Live!

Get 1:1 Help Now