C# .NET - freeze button control - Asked By Rahul Kumar on 30-Jan-12 06:55 AM

i want to freeze a button control on some button click event in windows application so suggest me a way to do this
Jitendra Faye replied to Rahul Kumar on 30-Jan-12 06:59 AM
Set Enabled =False for that particular button.

like this-

Button1.Enabled=False;
D Company replied to Rahul Kumar on 30-Jan-12 07:03 AM
hello friend.

try this.

<script>
   function DisableButton(b)
   {
    b.disabled = true;
    b.value = 'Submitting';
    b.form.submit();
   }

</script>

or

OnsecondButtion_Click()
{
buttion1.Enabled=false;
}


Regards
D
kalpana aparnathi replied to Rahul Kumar on 30-Jan-12 08:26 AM
hi,

Try this code

private void StartOrStop(object sender, EventArgs e)
{
  if (continueCalculating)
  {
    continueCalculating = false;
    startStopButton.Content = "Resume";
  }
  else
  {
    continueCalculating = true;
    startStopButton.Content = "Stop";
    startStopButton.Dispatcher.BeginInvoke(
      DispatcherPriority.Normal,
      new NextPrimeDelegate(CheckNextNumber));
  }
}