Click here to Skip to main content
15,892,161 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionHow to Read FlatFile format sequence of DNA [modified] Pin
phoipha20-Nov-08 0:41
phoipha20-Nov-08 0:41 
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 
I have a form that calls a dialogbox, Type, of the class dlgType. In the dialog box I have three radio buttons to select an equipment type, and a private variable - Selected - to contain the latest radio button selection. When the user clicks OK, the button handler assigns the value of Selected to a property called Choice. That's when the goofiness happens. Up to that point, Selected contains the correct value. But upon assigning Choice its value, the set function associated with Choice is called over and over again, causing a stack overflow error. I've watched it happen by stepping through the debug process (can I buy a replacement F11 key? I'm wearing this one out.) from the beginning of the code. The error definitely begins when the OK button is clicked and the set function is called. Can anyone suggest why this is happenning? And, by the way, I've tried it without the this prefix on Choice, too; same result. Here's the dialog code:



namespace SubMaint<br />
{<br />
    public partial class dlgType : Form<br />
    {<br />
        public dlgType()<br />
        {<br />
            InitializeComponent();<br />
     <br />
        }<br />
        private int Selected = 0;<br />
        public int Choice<br />
        {<br />
            get {return Choice;}<br />
            set {Choice = value;}<br />
                <br />
        }<br />
        <br />
        <br />
        private void rbTransformer_CheckedChanged(object sender, EventArgs e)<br />
        {<br />
            if (rbTransformer.Checked == true)<br />
            {<br />
                Selected = 1;<br />
            }<br />
        }<br />
<br />
        private void rbRegulator_CheckedChanged(object sender, EventArgs e)<br />
        {<br />
            if (rbRegulator.Checked == true)<br />
            {<br />
                Selected = 2;<br />
            }<br />
        }<br />
<br />
        private void rbRecloser_CheckedChanged(object sender, EventArgs e)<br />
        {<br />
            if (rbRecloser.Checked == true)<br />
            {<br />
                Selected = 3;<br />
            }<br />
<br />
        }<br />
<br />
        private void btnOK_Click(object sender, EventArgs e)<br />
        {<br />
            if (Selected > 0)<br />
                this.Choice = Selected;<br />
<br />
        }<br />
    }<br />
}


Any assistance will probably save me some hair...

"A Journey of a Thousand Rest Stops Begins with a Single Movement"

AnswerRe: Weirdness in a Dialog Box Pin
Simon P Stevens19-Nov-08 0:59
Simon P Stevens19-Nov-08 0:59 
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 

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.