Click here to Skip to main content
15,893,622 members
Home / Discussions / C#
   

C#

 
GeneralRe: USB camera code Pin
tom_dx14-Apr-05 16:25
tom_dx14-Apr-05 16:25 
GeneralRe: USB camera code Pin
Dave Kreskowiak14-Apr-05 16:35
mveDave Kreskowiak14-Apr-05 16:35 
GeneralRe: USB camera code Pin
eggie516-Apr-05 5:25
eggie516-Apr-05 5:25 
QuestionADOBC??? Pin
trk_wakil14-Apr-05 9:28
trk_wakil14-Apr-05 9:28 
AnswerRe: ADOBC??? Pin
kaschimer14-Apr-05 10:24
kaschimer14-Apr-05 10:24 
GeneralRe: ADOBC??? Pin
turbochimp14-Apr-05 12:11
turbochimp14-Apr-05 12:11 
QuestionEvent not fired on one of my computers? Pin
Snowjim14-Apr-05 8:50
Snowjim14-Apr-05 8:50 
QuestionAccess between classes? Pin
tantiboh14-Apr-05 7:17
tantiboh14-Apr-05 7:17 
I have two classes, ClassA and ClassB:

public class ClassA<br />
{<br />
//Variable definition<br />
private int intProperty;<br />
<br />
//Property definition<br />
public int Property<br />
{ <br />
get<br />
{<br />
return intProperty;<br />
} <br />
set<br />
{ <br />
intProperty = value; <br />
} <br />
}<br />
<br />
//Constructor<br />
public ClassA()<br />
{<br />
ClassBTest = new ClassB();<br />
}<br />
}


My question is, how do I access and modify ClassA.Property from ClassB?

For example (understanding that this doesn't actually work):

<br />
public class ClassB()<br />
{<br />
private int Function()<br />
{<br />
int Temp = ClassA.Property;<br />
Temp++<br />
ClassA.Property = Temp;<br />
}<br />
}


There's got to be a fundamental way to do this, I'm just missing that piece of information.

Thanks for your help.
AnswerRe: Access between classes? Pin
hooray14-Apr-05 7:29
hooray14-Apr-05 7:29 
GeneralCan't do that Pin
tantiboh14-Apr-05 7:42
tantiboh14-Apr-05 7:42 
GeneralRe: Can't do that Pin
hooray14-Apr-05 7:53
hooray14-Apr-05 7:53 
GeneralRe: Can't do that Pin
tantiboh14-Apr-05 8:14
tantiboh14-Apr-05 8:14 
GeneralRe: Can't do that Pin
turbochimp14-Apr-05 11:47
turbochimp14-Apr-05 11:47 
GeneralMaking PropertyGrid read only Pin
Tristan Rhodes14-Apr-05 7:03
Tristan Rhodes14-Apr-05 7:03 
GeneralRe: Making PropertyGrid read only Pin
Dave Kreskowiak14-Apr-05 8:29
mveDave Kreskowiak14-Apr-05 8:29 
GeneralRe: Making PropertyGrid read only Pin
Tristan Rhodes16-Apr-05 9:36
Tristan Rhodes16-Apr-05 9:36 
GeneralI don't know how to use CryptoStream class with Streamwriter and Streamreader Pin
Mohammed Aijaz Mohiuddin14-Apr-05 7:03
Mohammed Aijaz Mohiuddin14-Apr-05 7:03 
GeneralRe: I don't know how to use CryptoStream class with Streamwriter and Streamreader Pin
Steven Campbell14-Apr-05 7:24
Steven Campbell14-Apr-05 7:24 
GeneralMaking PropertyGrid read only Pin
Tristan Rhodes14-Apr-05 6:58
Tristan Rhodes14-Apr-05 6:58 
GeneralDTE.GetObject() Pin
jctk14-Apr-05 5:56
jctk14-Apr-05 5:56 
GeneralRe: DTE.GetObject() Pin
Dave Kreskowiak14-Apr-05 6:09
mveDave Kreskowiak14-Apr-05 6:09 
GeneralRe: DTE.GetObject() Pin
jctk14-Apr-05 7:33
jctk14-Apr-05 7:33 
QuestionC# XML Documentation comments - any way to make the HTML cross-browser? Pin
jimf1inmd14-Apr-05 5:13
jimf1inmd14-Apr-05 5:13 
AnswerRe: C# XML Documentation comments - any way to make the HTML cross-browser? Pin
leppie14-Apr-05 6:10
leppie14-Apr-05 6:10 
GeneralRe: C# XML Documentation comments - any way to make the HTML cross-browser? Pin
jimf1inmd15-Apr-05 4:49
jimf1inmd15-Apr-05 4:49 

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.