Solved

How to reference textbox in Form from another class

Posted on 2011-10-01
2
239 Views
Last Modified: 2013-12-16
I have a form with textboxes in it.  I have a separate class where I need to reference those textboxes.  I have tried everything I can think of and nothing seems to work.

What's the correct way to do this?
0
Comment
Question by:rmmarsh
2 Comments
 
LVL 4

Accepted Solution

by:
jacekmalinowski earned 500 total points
ID: 36897147
Hi,

You shouldn't mix up logic in class with GUI elements.

The best way is to make 2 methods in code behind in the from:

void BindTextboxesData()
{
// set here textboxes values from your class data.
}

void GetTexboxesData()
{
// get textboxes values and set to your class properties
}
0
 

Author Closing Comment

by:rmmarsh
ID: 36897209
Thank you...
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Where can I ask about my ASP.NET MVC project? 6 36
C# guarantee sql connection close 6 39
Store results in vb.net 3 20
SQL Query Help Top 1 and Distinct? 6 26
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

770 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