Solved

send data when calling methods

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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ā€¦
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!
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦

680 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