如何在C#中的单选按钮中设置滚动条? [英] how to set scrollbar in radio button in C#?

查看:111
本文介绍了如何在C#中的单选按钮中设置滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在用C#(winform)创建一个测验应用程序,所以我需要在单选按钮中添加scrollBar(如果文本在radioButton中溢出,则scrollBar将出现在单选按钮上) 。

我搜索过但从未找到任何关于此的建议..

我正在使用单选按钮作为选项,所以我需要坚持使用单选按钮控制..

如何在C#winform的单选按钮上设置scrollBar,如果有其他方法可以请建议我..



感谢先进.. < br $> b $ b

关于

Jayanta ...

Hi,
I'm creating a quiz application in C#(winform),so I need add scrollBar in Radio Button(if text is overflow in radioButton, the scrollBar will appear on radio button).
I searched but never find any suggestion on this..
I'm using radio button as option so I need to stick on radio button Control..
How to set scrollBar on Radio button in C# winform, If there is another way to do Please suggest me..

thanks in advanced..

regard
Jayanta...

推荐答案

RadioButton不继承滚动功能。但是,RadioButton Control确实有一个'AutoEllipsis属性,如果设置为'true ...并且'RadioButton的'AutoSize属性设置为'false ...将导致RadioButton的完整文本显示为弹出-b。



在实践中:任何大量的文本分配给RadioButton,弹出窗口可能超出Form的界限,看起来很糟糕。你无法在弹出的文本中强制换行。我不认为在问卷调查或调查中这是可以接受的。



我建议你创建一个将RadioButton和TextBox结合起来的UserControl:这并不困难创建。
A RadioButton does not inherit scrolling capability. However, the RadioButton Control does have an 'AutoEllipsis Property which, if set to 'true ... and the 'AutoSize Property of the RadioButton is set to 'false ... will result in the full Text of the RadioButton appearing as a pop-up.

In actual practice: with any substantial amount of Text assigned to the RadioButton, the pop-up may extend beyond the Form's boundaries, and look terrible ... there's no way you can force line-breaks in the pop-up Text. I don't think this would be acceptable in a questionaire, or survey.

I recommend you create a UserControl that combines a RadioButton with a TextBox: this is not difficult to create.


这篇关于如何在C#中的单选按钮中设置滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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