VB.Net错误提供程序控件属性出现在窗体上的所有其他控件上 [英] VB.Net Error Provider control properties appear on all other controls on the form

查看:108
本文介绍了VB.Net错误提供程序控件属性出现在窗体上的所有其他控件上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试使用VB.Net错误提供程序控件处理具有大约二十个字段的表单上的错误.我首先为每个用户输入字段添加一个,但是后来我意识到,每个错误提供者的三个属性都出现在表单上的每个其他控件中.

我想这并不是一个真正的问题",但是在添加了我需要的20个左右的错误提供程序控件之后,我将在表单上的所有其他控件中最终获得60个附加属性.

我只能以为自己做错了什么.我以为通过将错误提供程序拖动到控件上,它将使自己与该控件相关联,但它却与整个表单相关联.

我唯一的另一种选择是添加很多标签,但是我发现自从控件就在那里了.
任何建议将不胜感激.

Hi
I''m trying to handle errors on a form with about two dozen fields using the VB.Net Error Provider control. I started by adding one for each user input field, but then I realised that three properties for each Error Provider were appearing in every other control on the form.

I suppose this isn''t really a "problem", but after adding the 20 or so Error Provider controls I need, I''ll end up with 60 additional properties in every other control on the form.

I can only assume I''m doing something wrong. I thought that by dragging an Error Provider onto a control it would associate itself with that control, but it''s associated with the entire form instead.

My only other alternative is to add in a whole lot of labels, but I figured since the control was there....

Any advice would be appreciated.

推荐答案

我建​​议您使用ToolTip和ErrorProvider.
为此检查此链接[ ^ ]
或者您可以尝试这份CodeProject文章[ ^ ]
做好你的工作
I suggest you to Use ToolTip and ErrorProvider.
for this Check This link[^]
or you can try this CodeProject article [^]
to get your job done


Damn我感觉像个菜鸟.我没有意识到您可以在多个控件上使用错误提供程序!!

我创建了两个错误提供程序-一个用于缺少字段,一个用于格式错误,为他们提供了自己的精美图标,它的工作原理就像是一种魅力.

非常感谢!
Damn I feel like a noob. I didn''t realise you could use the Error Provider on more than one control!!

I created two Error Providers - one for missing fields and one for format errors, gave them their own spiffy icons and it works like a charm.

Thanks so much!


这篇关于VB.Net错误提供程序控件属性出现在窗体上的所有其他控件上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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