Click here to Skip to main content
15,905,322 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionInvoke Windows app on client from Server Pin
balu1234519-Nov-08 19:23
balu1234519-Nov-08 19:23 
AnswerRe: Invoke Windows app on client from Server Pin
Dave Kreskowiak20-Nov-08 1:53
mveDave Kreskowiak20-Nov-08 1:53 
QuestionRe: Invoke Windows app on client from Server Pin
led mike20-Nov-08 4:39
led mike20-Nov-08 4:39 
AnswerRe: Invoke Windows app on client from Server Pin
balu1234521-Nov-08 22:00
balu1234521-Nov-08 22:00 
GeneralRe: Invoke Windows app on client from Server Pin
led mike24-Nov-08 5:50
led mike24-Nov-08 5:50 
Questionlocalizing list of values in Script combo of Font dialog. Pin
Member 232448319-Nov-08 7:35
Member 232448319-Nov-08 7:35 
QuestionWeirdness in a Dialog Box Pin
Roger Wright18-Nov-08 18:37
professionalRoger Wright18-Nov-08 18:37 
AnswerRe: Weirdness in a Dialog Box Pin
Simon P Stevens19-Nov-08 0:59
Simon P Stevens19-Nov-08 0:59 
Your problem is here:
public int Choice
{
    get {return Choice;}
    set {Choice = value;}
}
In the set block, you are taking the assigned value, and setting to Choice, which calls the same bit of code again. A property isn't a way of storing data, it is a way of accessing data that is stored privately in the object. You need to add a backing storage variable for the data. Like this:
private int _choice;
public int Choice
{
    get
    {
        return _choice;
    }
    set
    {
        _choice = value;
    }

}
Here the private variable _choice is used to store the data. The public property Choice is used to get & set that data.

(If you are using VS2008, there is a kind of shortcut property. You can just write this:
public int Choice
{
    get;
    set;
}
and it will automatically manage the backing variable for the data storage itself. You still need a backing variable, but in this case it is basically a visual studio trick, when it compiles the code it will just create the backing variable for you. Personally, I don't like this though, I prefer to declare it all in full, I think it's clearer.)

Simon

GeneralRe: Weirdness in a Dialog Box Pin
Roger Wright19-Nov-08 2:04
professionalRoger Wright19-Nov-08 2:04 
GeneralRe: Weirdness in a Dialog Box Pin
Simon P Stevens19-Nov-08 2:54
Simon P Stevens19-Nov-08 2:54 
GeneralRe: Weirdness in a Dialog Box Pin
Roger Wright19-Nov-08 3:57
professionalRoger Wright19-Nov-08 3:57 
GeneralRe: Weirdness in a Dialog Box Pin
Simon P Stevens19-Nov-08 4:06
Simon P Stevens19-Nov-08 4:06 
GeneralRe: Weirdness in a Dialog Box Pin
Roger Wright19-Nov-08 13:38
professionalRoger Wright19-Nov-08 13:38 
Questionwhere can i find that project (attach an existing console to an form app as parent) Pin
Tiago Conceição18-Nov-08 12:20
Tiago Conceição18-Nov-08 12:20 
AnswerRe: where can i find that project (attach an existing console to an form app as parent) Pin
Christian Graus18-Nov-08 20:30
protectorChristian Graus18-Nov-08 20:30 
GeneralRe: where can i find that project (attach an existing console to an form app as parent) Pin
Tiago Conceição19-Nov-08 2:33
Tiago Conceição19-Nov-08 2:33 
QuestionHow to register COM components into C#.Net window applications Pin
veereshIndia17-Nov-08 22:37
veereshIndia17-Nov-08 22:37 
AnswerCP IGNORE: Crossposted about a dozen times... Pin
Dave Kreskowiak18-Nov-08 2:09
mveDave Kreskowiak18-Nov-08 2:09 
RantRe: CP IGNORE: Crossposted about a dozen times... Pin
Paul Conrad18-Nov-08 4:59
professionalPaul Conrad18-Nov-08 4:59 
QuestionToo Simple For An Article, But I'm Stuck Pin
Roger Wright17-Nov-08 16:25
professionalRoger Wright17-Nov-08 16:25 
AnswerRe: Too Simple For An Article, But I'm Stuck Pin
Mycroft Holmes17-Nov-08 21:22
professionalMycroft Holmes17-Nov-08 21:22 
GeneralRe: Too Simple For An Article, But I'm Stuck Pin
Urs Enzler19-Nov-08 3:44
Urs Enzler19-Nov-08 3:44 
GeneralRe: Too Simple For An Article, But I'm Stuck Pin
Mycroft Holmes19-Nov-08 4:38
professionalMycroft Holmes19-Nov-08 4:38 
GeneralRe: Too Simple For An Article, But I'm Stuck Pin
_Maxxx_23-Nov-08 19:01
professional_Maxxx_23-Nov-08 19:01 
Questionhow to create session in windows Application [modified] Pin
arunmca.r16-Nov-08 18:57
arunmca.r16-Nov-08 18:57 

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.