Click here to Skip to main content
15,912,329 members
Home / Discussions / C#
   

C#

 
GeneralRe: assign number to variable name Pin
Guffa25-Oct-07 11:04
Guffa25-Oct-07 11:04 
GeneralRe: assign number to variable name Pin
pmarfleet25-Oct-07 11:43
pmarfleet25-Oct-07 11:43 
GeneralRe: assign number to variable name Pin
MasterSharp25-Oct-07 14:54
MasterSharp25-Oct-07 14:54 
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 
There is more than one way to do this. It depend on the context.

I will show you 2 way, the first one is simple if the class only update this form and they are closely related. The other is an exemple for a class that can update this data in differents forms that can have differents controls but the same data.

***** Example 1:
 <br />
class Form1<br />
{<br />
<br />
   //All control in this class<br />
   private ListBox list1 = new ListBox();<br />
   private TextBox box1 = new TextBox();<br />
<br />
   public ListBox List1 {<br />
      get { return list1;}<br />
   }<br />
<br />
   public TextBox Box1{<br />
      get { return box1;}<br />
   }<br />
<br />
<br />
<br />
}<br />
<br />
class myClass<br />
{<br />
   UpdateForm1(Form1 frm)<br />
   {<br />
      frm.List1.Items.Add("TEST"); // or whatever<br />
      frm.Box1.Text = "TEST";<br />
   }<br />
<br />
}<br />


***** Example 2:

 <br />
interface IUpdateForm<br />
{<br />
   UpdateData(string[] items, string newText);<br />
}<br />
<br />
class Form1 : IUpdateForm<br />
{<br />
<br />
   //All control in this class<br />
   private ListBox list1 = new ListBox();<br />
   private TextBox box1 = new TextBox();<br />
<br />
   public Form_Load()<br />
   {<br />
      new myClass().UpdateForm(this);<br />
   }<br />
<br />
   public UpdateData(string[] items, string newText)<br />
   {<br />
      this.list1.Items.Add(items);<br />
      this.box1.Text = newText;<br />
      <br />
   }<br />
<br />
}<br />
<br />
class myClass<br />
{<br />
   UpdateForm(IUpdateForm uptFrm)<br />
   {<br />
      // Get some data<br />
      uptFrm.UpdateData(someArray, someText);<br />
   }<br />
<br />
}<br />


There are more possibilities but theses two examples will give you the idea.
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 
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 

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.