RadioButtons无法正常突出显示

编程入门 行业动态 更新时间:2024-10-26 05:16:46
本文介绍了RadioButtons无法正常突出显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的表单上,我有4个RadioButtons,每个都将其外观设置为'Button'。在我的程序中,我更改了每个RadioButton的ForeColour,BackColour和AutoCheck状态,如下所示:

On my form, I have 4 RadioButtons, each with it's appearance set to 'Button'. In my program, I change each of these RadioButtons' ForeColour, BackColour and AutoCheck status, as below:

ARadioButton.AutoCheck = False ARadioButton.BackColor = Color.FromKnownColor(KnownColor.ControlLightLight) ARadioButton.ForeColor = Color.FromKnownColor(KnownColor.ControlDark)

但是,稍后,我将这些属性重置为默认值:

However, later on, I reset these properties back to default:

ARadioButton.AutoCheck = True ARadioButton.BackColor = DefaultBackColor ARadioButton.ForeColor = DefaultForeColor

我的问题是,而不是整个按钮突出显示(点击后)这个变化,只有外部亮点,如下图所示。 最初: i30.photobucket/albums/c339/JOFA666/Original_zpsd8b20ef3.png [ ^ ] 更改后,RadioButtons重置: i30.photobucket/albums/c339/JOFA666/AfterChanges_zpsa23824c0。 png [ ^ ] 我知道这可能看起来很卑鄙,但我希望整个按钮突出显示用户点击RadioButton时,而不仅仅是外部。有没有办法我能以某种方式重置这个? 感谢您的帮助!

My issue is that instead of the entire button highlighting (when clicked on) after this change, only the outside highlights, as in the images below. Originally: i30.photobucket/albums/c339/JOFA666/Original_zpsd8b20ef3.png[^] After changes made, and RadioButtons reset: i30.photobucket/albums/c339/JOFA666/AfterChanges_zpsa23824c0.png[^] I know this may seem menial, but I would like the entire button to highlight when the user clicks on the RadioButton, not just the outside. Is there a way I could somehow reset this? Thanks for the help!

推荐答案

重置的解决方案很简单: The solution for resetting is simply: ARadioButton.BackColor = Color.Transparent

更多推荐

RadioButtons无法正常突出显示

本文发布于:2023-11-08 08:02:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568810.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法正常   RadioButtons

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!