Click here to Skip to main content
16,004,782 members
Home / Discussions / C#
   

C#

 
GeneralRe: assign number to variable name Pin
ThomasBates26-Oct-07 9:51
ThomasBates26-Oct-07 9:51 
JokeRe: assign number to variable name Pin
codemunkeh25-Oct-07 12:37
codemunkeh25-Oct-07 12:37 
AnswerRe: assign number to variable name Pin
Anthony Mushrow25-Oct-07 13:10
professionalAnthony Mushrow25-Oct-07 13:10 
QuestionHow to Access Control on a From from different class Pin
A.Asif25-Oct-07 9:07
A.Asif25-Oct-07 9:07 
AnswerRe: How to Access Control on a From from different class Pin
Alain Normandin25-Oct-07 10:06
Alain Normandin25-Oct-07 10:06 
GeneralRe: How to Access Control on a From from different class Pin
A.Asif25-Oct-07 10:40
A.Asif25-Oct-07 10:40 
AnswerRe: How to Access Control on a From from different class Pin
Alain Normandin26-Oct-07 10:29
Alain Normandin26-Oct-07 10:29 
AnswerRe: How to Access Control on a From from different class Pin
darkelv25-Oct-07 23:55
darkelv25-Oct-07 23:55 
There are many ways to do it, but IMO, it's best to separate the class (business object) from the UI, unless the class is specifically used for updating Form1.

myClass should provide data or values only, as public properties, it should be up to the form to retrieve the value from myClass, instead of myClass updating the UI elements directly.

class Form1
{
private myClass theClass;

public Form1()
{
theClass = new myClass();
theClass.DoSomeCalculation();
UpdateUI();
}

private void UpdateUI()
{
// Update ListBox from theClass.ListBoxValue
// Update TextBox from theClass.TextBoxValue
}
}



class myClass
{
public string[] ListBoxValue { get; set; }
public string TextBoxValue { get; set; }

public void DoSomeCalculation()
{
}

}

YMMV.
QuestionHow to check for Operating System? Pin
Khoramdin25-Oct-07 8:47
Khoramdin25-Oct-07 8:47 
AnswerRe: How to check for Operating System? Pin
conemajstor25-Oct-07 9:30
conemajstor25-Oct-07 9:30 
QuestionString Format Help! Pin
solutionsville25-Oct-07 8:36
solutionsville25-Oct-07 8:36 
AnswerRe: String Format Help! Pin
pmarfleet25-Oct-07 9:20
pmarfleet25-Oct-07 9:20 
GeneralRe: String Format Help! Pin
solutionsville25-Oct-07 9:22
solutionsville25-Oct-07 9:22 
GeneralRe: String Format Help! Pin
pmarfleet25-Oct-07 9:32
pmarfleet25-Oct-07 9:32 
GeneralRe: String Format Help! Pin
solutionsville25-Oct-07 9:33
solutionsville25-Oct-07 9:33 
QuestionDataSet.DataTable.Select() returns undefined value Pin
Rukmini T25-Oct-07 8:32
Rukmini T25-Oct-07 8:32 
AnswerRe: DataSet.DataTable.Select() returns undefined value Pin
pmarfleet25-Oct-07 9:40
pmarfleet25-Oct-07 9:40 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
Rukmini T25-Oct-07 10:58
Rukmini T25-Oct-07 10:58 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
pmarfleet25-Oct-07 11:08
pmarfleet25-Oct-07 11:08 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
Rukmini T25-Oct-07 11:16
Rukmini T25-Oct-07 11:16 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
pmarfleet25-Oct-07 11:40
pmarfleet25-Oct-07 11:40 
GeneralRe: DataSet.DataTable.Select() returns undefined value Pin
Paul Conrad23-Dec-07 15:02
professionalPaul Conrad23-Dec-07 15:02 
QuestionYUV player Pin
project c25-Oct-07 8:22
project c25-Oct-07 8:22 
QuestionDesign Patterns Pin
ilango gandhi25-Oct-07 7:30
ilango gandhi25-Oct-07 7:30 
AnswerRe: Design Patterns Pin
led mike25-Oct-07 8:20
led mike25-Oct-07 8:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.