Solved

send data when calling methods

Posted on 2009-07-04
4
191 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 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

11 Experts available now in Live!

Get 1:1 Help Now