1
Answer

Object Data Binding

Photo of Alex Rivenbark

Alex Rivenbark

16y
2.5k
1
Hello all. I am having a problem. I am a student in college, working part time in the lab for a co-op. A student came in with a problem that I could not help her fix. The application has 2 textboxes for user input (width and height), and 2 read-only text boxes to display the area and perimeter of the shape. Also, there is a dropdownlist that has the items 'circle', 'square' and 'rectangle' in it. I need to use a databinding control to bind the text boxes so that when the focus leaves the 2 text boxes with user-defined values, the read only textboxes display the correct result for the shape that is selected in the dropdownlist control, without having to click any calculate button. Can anyone help me out with this? Thanks.

Answers (1)

0
Photo of Kunal Vaishya
NA 4.1k 266.1k 12y
Dear this is For 15 days you can change as per your requirment




Please try thic Procedure put this om main for load event
its also restrict of date change itvery use full

let me know


  private DateTime RegDate;
  private DateTime todayDate;
  private void CheckLicenceAgreement()
  {
  try
  {
  //If Not Exist The Add Date Firet Time
  if (Convert.ToString(Application.UserAppDataRegistry.GetValue("RegDate")) == "")
  {
  RegDate = DateTime.Now;
  RegDate  = RegDate.AddDays(15);

  Application.UserAppDataRegistry.SetValue("RegDate", RegDate.ToString("yyyyMMdd"));
  Application.UserAppDataRegistry.SetValue("ApplicationStart", "1");
  }
  else
  {
  //Check It

  Int32 Regdt;
  Int32 todt;
  Regdt = Convert.ToInt32(Application.UserAppDataRegistry.GetValue("RegDate"));
  todt = Convert.ToInt32(System.DateTime.Now.ToString("yyyyMMdd"));

  if ((todt > Regdt) || (Convert.ToString(Application.UserAppDataRegistry.GetValue("ApplicationStart")))=="0")
  {
  Application.UserAppDataRegistry.SetValue("ApplicationStart", "0");
  Application.Exit(); 
  }
  }
  }
  catch (Exception ex)
  {
  Application.Exit(); 
  } 
  }