Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
here have a problem in my window application using C#




in application ,
when i make a condition like "if else".

this are executed again ,when its executed previous.

for example, here my code below

C#
if (rdodate.Checked)
            {
                dateTimePicker1.Enabled = true;
                ddmonth_fee_report.Enabled = false;
            }
            else if(rdomonth.Checked)
            {
                ddmonth_fee_report.Enabled = true;

                dateTimePicker1.Enabled = false;
            }





//
in this code, when its execute successfully top to bottom then after its execute again check condition


how can solve this problem ....help me
Posted
Comments
ccalma 24-Apr-14 1:50am    
In what event did you put the code?
mukesh mourya 24-Apr-14 1:55am    
sir, win form have a date picker and a combobox in win Application

i wont when datepicker is enable then at this time conbobox be disable
mukesh mourya 24-Apr-14 1:57am    
also this type of problem is generating when i generate dynamic label on condition (if else)
ccalma 24-Apr-14 2:01am    
Are you using the radio button to determine which control will be disabled?
mukesh mourya 24-Apr-14 2:11am    
ya sir i am using radio button to determine

1 solution

Try this code and let me know the result.

C#
private void rdodate_CheckedChanged(object sender, EventArgs e)
     {

         if (rdodate.Checked)
         {
             dateTimePicker1.Enabled = true;
             ddmonth_fee_report.Enabled = false;
         }

     }

     private void rdomonth_CheckedChanged(object sender, EventArgs e)
     {
         if (rdomonth.Checked)
         {
             ddmonth_fee_report.Enabled = true;
             dateTimePicker1.Enabled = false;
         }

     }
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900