禁用按钮时如何设置样式按钮? [英] How to set style button when the button is disabled?

查看:215
本文介绍了禁用按钮时如何设置样式按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,请帮助我!!!!
我有一个按钮.当我单击此按钮时,它将被禁用.
问题是禁用按钮的样式不会返回表面.
我希望我的禁用"按钮返回到表面,只是禁用了按钮上的文字.
(与主题类模式下的禁用按钮相同.)

Dear All, plz help me!!!
I have a button. When i click this button, it will be disabled.
The problem is style of disable button don''t return to surface.
I want my disable button return to surface, just text on button is disabled.
(Same with disable button at theme classis mode).

推荐答案

问题在于禁用按钮的样式不会重现."
您的问题的这一部分尚不清楚. 返回地面"是什么意思?
"The problem is style of disable button dont return to surface."
This part of your problem is not clear. What do you mean by "return to surface"?


确定.我会尽力解释清楚.
1.创建表单应用程序,然后将一个按钮(btn1)添加到表单中.
2.单击该按钮时,该按钮将被禁用(btn1.Enable = false).
3.查看按钮的状态(主题:XP).
4.然后在计算机上按主题类别转移主题XP.
5.比较按钮的状态.
我希望在XP主题模式下禁用按钮,而在Classis主题模式下禁用按钮.你了解我吗?
对不起,事实是我的英语不好.很难解释清楚些.
希望您能帮助我.
非常感谢
OK. I will try to explain clearly.
1. Create Form application and add a button(btn1) into form.
2. When click the button, it will be disabled(btn1.Enable = false).
3. look status of button(theme: XP).
4. Then tranfer your theme XP by theme classis on your computer.
5. Compare status of button.
I want my button is disabled at XP theme mode that same with button is disabled at Classis theme mode. Do you understand me?
I''m sorry, the truth is my english is not good. so dificult to explain more cleary.
Hope you try to help me.
Thank''s very much


好,请告诉我您是否使用WPF或WinForms.

对于Winforms,您需要更改计算机主题,或者在禁用按钮时更改一次颜色或外观.

如果您使用的是WPF,则可以轻松完成此操作,只需在IsEnabled = false时提及样式触发器即可定义其控制模板甚至样式.

:rose:
Well, please tell me if you are in WPF or WinForms.

In case of Winforms, you need either change the computer theme, or you need to change the color or appearance once when the button is Disabled.

If you are in WPF, you can quite easily do this, just mentioning the Style Trigger to define its controltemplate or even style when IsEnabled = false.

:rose:


这篇关于禁用按钮时如何设置样式按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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