解决方案 »

  1.   

    this.Enabled = false;
    xxx.ShowDialog();
    ...
    this.Enabled = true;
      

  2.   

    不行,无论在WPF中还是在winform中这种方式,窗体没有变化
      

  3.   

    不行,无论在WPF中还是在winform中这种方式,窗体没有变化
    WPF图片置灰
    ImageSource isource = image.Source;
                FormatConvertedBitmap fcb = new FormatConvertedBitmap((BitmapSource)isource, PixelFormats.Gray32Float, null, 0);
                image.Source = fcb;
                image.OpacityMask = new ImageBrush(isource);
      

  4.   

    不行,无论在WPF中还是在winform中这种方式,窗体没有变化
    WPF图片置灰
    ImageSource isource = image.Source;
                FormatConvertedBitmap fcb = new FormatConvertedBitmap((BitmapSource)isource, PixelFormats.Gray32Float, null, 0);
                image.Source = fcb;
                image.OpacityMask = new ImageBrush(isource);
    正解,谢谢
      

  5.   

    不行,无论在WPF中还是在winform中这种方式,窗体没有变化
    WPF图片置灰
    ImageSource isource = image.Source;
                FormatConvertedBitmap fcb = new FormatConvertedBitmap((BitmapSource)isource, PixelFormats.Gray32Float, null, 0);
                image.Source = fcb;
                image.OpacityMask = new ImageBrush(isource);
    正解,谢谢把背景存为图片再加载到image控件?
      

  6.   

    不行,无论在WPF中还是在winform中这种方式,窗体没有变化
    WPF图片置灰
    ImageSource isource = image.Source;
                FormatConvertedBitmap fcb = new FormatConvertedBitmap((BitmapSource)isource, PixelFormats.Gray32Float, null, 0);
                image.Source = fcb;
                image.OpacityMask = new ImageBrush(isource);
    正解,谢谢把背景存为图片再加载到image控件?
    终于找到了点相关资料:
    http://q.cnblogs.com/q/25858/
    http://msdn.microsoft.com/zh-cn/library/system.windows.media.imaging.formatconvertedbitmap(v=VS.85).aspx
    http://blog.csdn.net/oyi319/article/details/6653452
    根据参考资料和理解:
    VS是采用WPF的方式,对图片设置了统一样式控制,如在IsEnabled为False时,进行灰度处理
    而其他的控件的样式同样做了IsEnabled为False的Trigger处理,将选中项目的颜色设置为灰色
    也就是窗体相关的所有控件,均进行了相关的IsEnabled的Trigger处理。