避免同时单击按钮 [英] Avoiding the Simultaneaous Button Clicks

查看:75
本文介绍了避免同时单击按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的应用程序中,我具有搜索顺序"的搜索"按钮.当我输入订单号和订单类型并单击提交按钮时,它将显示该订单号的文档.但是,应用程序的问题是当我同时单击搜索"按钮时它会复制数据.单击多个按钮上的数据.

谢谢,
乌梅什·塔亚德

Hi,

In my application i have Search button for Search Order. When i enter the Order no and order type and click submit button then it shows the documents for that order no.But,The Problem with the application is when i click the Search button simultaneously it replicates the data.I want to avoid the replication of the data on multiple button click.

Thanks,
Umesh Tayade

<Button Content="Search"  Margin="5,0,0,0" Height="21" Width="100" Grid.Row="0" Grid.Column="9" HorizontalAlignment="Left" VerticalAlignment="Center" Style="{StaticResource grayButton}" x:Name="btnSearch" Click="btnSearch_Click"/> 





private void btnSearch_Click(object sender, RoutedEventArgs e)
{
   if (IsValid() && isLineValid)
   {
      if (null != multiDocViewModelConnector.ViewState && multiDocViewModelConnector.ViewState.FilterDescripter != null)
                    multiDocViewModelConnector.ViewState.FilterDescripter.Clear();
      __searchCriteria();
   }
  }

推荐答案

0)您显示的代码完全没有帮助我们帮助您解决问题的信息.

1)复制数据"是什么意思?

2)__searhCriteria()是做什么的?

3)您是否考虑过在调试器下运行该应用程序,以查看为什么看到的行为正在发生?

4)可能是用户单击按钮时始终需要清除FilterDescriptor列表.当然,这只是一个猜测.
0) The code you''ve shown does absolutely NOTHING to allow us to help you with your problem.

1) What do you mean by "replicates the data"?

2) What does __searhCriteria() do?

3) Have you considered running the app under the debugger to see WHY the behavior you''re seeing is happening?

4) It might be that you need to ALWAYS clear the FilterDescriptor list when the user clicks the button. Of course this is just a guess.


这篇关于避免同时单击按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆