TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mike Pischke
NA
11
0
multiple .cs files using shared method, using form name as a parameter
Oct 6 2009 2:39 PM
Take a look at this basic example: public static void headbar(string formname, string heading) { string oldheading; oldheading=formname.Text; formname.Text=oldheading+" "+heading; } Then when I initiate a form (say "myform"), I would: headbar("myform","testing"); The intended functionality here is to have this common method be used to add verbiage to the .Text property of a form, where I'm providing the form name as a parameter. (There is a 'bigger' issue at stake, but this simple example illustrates what I don't know how to accomplish). The code above won't compile, because "Text" is not a property of the string variable "formname". But the contents of "formname" would have a "Text" property. How would I change my code above to work as intended?
Reply
Answers (
4
)
Error while fetching EventLog entries
invoking keyup for javascript method in dynamic created textbox with dynamic name