组合框在c#中禁用时看到边框 [英] combobox saw border when it disable in c#

查看:79
本文介绍了组合框在c#中禁用时看到边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我有桌面应用程序在C#中......我将combox样式设置为Dropdownlist并且平坦。但是当我禁用组合框时,它显示为围绕它的黑色边框...请帮助我发生了什么?

Hi i have Desk top Application in C#... I set the combox style as Dropdownlist and flat..but when i disable the combobox it show like black border around it...pls help me what is there happen??

推荐答案

没有标准的方法来做AFAIK - 这是控件的预期行为,并且没有Border属性,所以很可能你被困在了。



您可以自己摆脱它,从ComboBox继承您自己的控件并自己处理绘图(只有在禁用时才覆盖边框应该这样做 - 我还没试过)或者只是隐藏Combobox并在同一个地方用相同的文字显示一个固定的标签!
There is no standard way to do that AFAIK - it's an intended behaviour of the control and there is no Border property, so the chances are you are stuck with it.

You could get rid of it yourself, by inheriting your own control from ComboBox and handling the drawing yourself (just overwriting the border when it is disabled should do it - I haven't tried) or just hide the Combobox and display a fixed label in the same place with the same text!


你想要禁用你的组合框只是动态地看到borderproperty

它将解决!
wherever you want to disable your combobox just see borderproperty dynamically
it will solve!


平面样式显示为黑色边框...如果更改,请选择样式作为标准...
flat style appears like black border...if you change, select style as standard...


这篇关于组合框在c#中禁用时看到边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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