多个消息框显示 [英] Multiple Message box display

查看:84
本文介绍了多个消息框显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用滑块,因为我正在使用条件和消息框,问题是如果我移动滑块,则多个消息框将显示如何显示唯一一个消息框,请帮帮我

I am using slider, in that i am using if condition and message box ,problem is if i move the slider the multiple message box will displaying how to show the only one message box please help me

private void slider_F1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {

                    p1 = Convert.ToDouble(textBox_F1Yngs.Text);
                    p2 = Convert.ToDouble(textBox_F2Yngs.Text);
                    p3 = Convert.ToDouble(textBox_F3Yngs.Text);
            if(p1 ==0 ||p2 ==0 || p ==0)
            {
                //MessageBox.Show("please select all the values");
                slider_F1.Value = 0;
                slider_F1.Minimum = 0;
            }

            else if(p1>p2 || p2>p3 || p1>p3)
            {



              MessageBox.Show("Check Whether Density of Fluid1 (ρ1) < Density of Fluid2 (ρ2)  <  Density of Fluid3 (ρ3)");
          
  slider_F1.Value = 0;

       
           }

推荐答案

你好,

我不确定,但是听起来好像slider(?)会生成很多事件?
也许您可以在启动过程时禁用滑块,然后在退出过程之前重新启用它?


还有上面的线...
Hello,

I''m not sure, but it sounds like the slider(?) is generating lots of events?
Maybe you could disable the slider as you start the procedure and re-enable it before you exit the procedure?


Also the line above...
if(p1 ==0 ||p2 ==0 || p ==0)




不应该吗?




Shouldnt that be?

if(p1 ==0 ||p2 ==0 || p3 ==0)


这篇关于多个消息框显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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