本文介绍了如果连接了触摸屏,则整个解决方案的替代滚动条样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我在连接触控显示器时需要替代Scrollbar样式(然后滚动条更大)。



我检查后面的代码是否附有任何触摸:



Hello,

I Need an alternative Scrollbar Style for my whole Application when Touch Displays are attached (then the scrollbar is larger).

I check if there is any touch attached in code behind:

[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
static extern int GetSystemMetrics(int nIndex);

const int SM_MAXIMUMTOUCHES = 95;

static readonly bool isTouchAttached = GetSystemMetrics(SM_MAXIMUMTOUCHES) 

然后我计划使用Inherits在我的滚动条样式中创建一个附属属性,但由于可能存在性能问题,我不允许这样做。



我们的解决方案中有一个Scrollbar Style,它出现在MergedDictionary的XAML中,用于我们所有的控件,没有代码。



Any想法如何使用第二种替代风格的普通滚动条样式和切换某种方式使用那个?



是否有任何最佳做法或类似于这样的案例?



非常感谢!



Eric

Then I planned to create an attachedproperty in my scrollbarbar style with Inherits but I am not allowed to because of possible Performance issues.

We got a Scrollbar Style in our solution which is appearing in a XAML in a MergedDictionary for all our controls without a code behind.

Any idea how I can use a 2nd aternative style for the General scrollbar style and Switch somehow for using that one?

Are there any best practices or something for a case like this?

Thanks a lot!

Eric

推荐答案


这篇关于如果连接了触摸屏,则整个解决方案的替代滚动条样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 23:23