Solved

How to reference textbox in Form from another class

Posted on 2011-10-01
2
237 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

23 Experts available now in Live!

Get 1:1 Help Now