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

C#

 
AnswerRe: How do I exit the program from the main form's constructor Pin
Leslie Sanford30-Mar-07 9:07
Leslie Sanford30-Mar-07 9:07 
GeneralRe: How do I exit the program from the main form's constructor Pin
dino209430-Mar-07 9:09
dino209430-Mar-07 9:09 
AnswerRe: How do I exit the program from the main form's constructor Pin
Thomas Stockwell1-Apr-07 4:37
professionalThomas Stockwell1-Apr-07 4:37 
Questionverify user can access a file Pin
minmanmax30-Mar-07 8:43
minmanmax30-Mar-07 8:43 
AnswerRe: verify user can access a file Pin
Ed.Poore30-Mar-07 9:09
Ed.Poore30-Mar-07 9:09 
GeneralRe: verify user can access a file Pin
minmanmax30-Mar-07 10:17
minmanmax30-Mar-07 10:17 
GeneralRe: verify user can access a file Pin
Ed.Poore30-Mar-07 12:24
Ed.Poore30-Mar-07 12:24 
GeneralRe: verify user can access a file Pin
minmanmax30-Mar-07 12:52
minmanmax30-Mar-07 12:52 
GeneralRe: verify user can access a file Pin
Ed.Poore30-Mar-07 23:19
Ed.Poore30-Mar-07 23:19 
GeneralRe: verify user can access a file Pin
minmanmax2-Apr-07 8:51
minmanmax2-Apr-07 8:51 
AnswerRe: verify user can access a file Pin
Vasudevan Deepak Kumar31-Mar-07 4:29
Vasudevan Deepak Kumar31-Mar-07 4:29 
QuestionGet n Set Pin
umashankergr830-Mar-07 8:34
umashankergr830-Mar-07 8:34 
AnswerRe: Get n Set [modified] Pin
J$30-Mar-07 8:40
J$30-Mar-07 8:40 
Get and Set are used in properties. So for instance, if you have a class with a Name property, you can delcare that as follows:
<br />
// Private member variable<br />
private string msName;<br />
// Property that exposes the private member variable msName<br />
public string Name<br />
{<br />
  get { return msName; }<br />
  set { msName = value; }<br />
}<br />

You use the Get to access the private member variable, and the Set to assign to the private member variable.

If you have an instance of your class you can use it as follows:
<br />
myObject.Name = "your name here";<br />
MessageBox.Show(myObject.Name);<br />


-- modified at 14:50 Friday 30th March, 2007
GeneralRe: Get n Set Pin
Colin Angus Mackay30-Mar-07 8:59
Colin Angus Mackay30-Mar-07 8:59 
GeneralRe: Get n Set Pin
J$30-Mar-07 10:13
J$30-Mar-07 10:13 
AnswerRe: Get n Set Pin
Vasudevan Deepak Kumar31-Mar-07 4:31
Vasudevan Deepak Kumar31-Mar-07 4:31 
QuestionAttaching my own form Pin
Esmo200030-Mar-07 8:01
Esmo200030-Mar-07 8:01 
QuestionA control as a property, or Delete Notification Pin
Cnight Stalker30-Mar-07 7:08
Cnight Stalker30-Mar-07 7:08 
QuestionXML does not like & Pin
LCI30-Mar-07 7:05
LCI30-Mar-07 7:05 
AnswerRe: XML does not like & Pin
andyharman30-Mar-07 7:32
professionalandyharman30-Mar-07 7:32 
QuestionUsing Length attribute on a string Pin
LCI30-Mar-07 6:51
LCI30-Mar-07 6:51 
AnswerRe: Using Length attribute on a string Pin
LCI30-Mar-07 6:56
LCI30-Mar-07 6:56 
QuestionCan i drag items from listboxes? Pin
sinosoidal30-Mar-07 5:41
sinosoidal30-Mar-07 5:41 
AnswerRe: Can i drag items from listboxes? Pin
originSH30-Mar-07 6:03
originSH30-Mar-07 6:03 
Questionaccess through Network with a gateway Pin
mfmaneef30-Mar-07 5:32
mfmaneef30-Mar-07 5:32 

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.