• <legend id='k7uFb'><style id='k7uFb'><dir id='k7uFb'><q id='k7uFb'></q></dir></style></legend>

    1. <i id='k7uFb'><tr id='k7uFb'><dt id='k7uFb'><q id='k7uFb'><span id='k7uFb'><b id='k7uFb'><form id='k7uFb'><ins id='k7uFb'></ins><ul id='k7uFb'></ul><sub id='k7uFb'></sub></form><legend id='k7uFb'></legend><bdo id='k7uFb'><pre id='k7uFb'><center id='k7uFb'></center></pre></bdo></b><th id='k7uFb'></th></span></q></dt></tr></i><div id='k7uFb'><tfoot id='k7uFb'></tfoot><dl id='k7uFb'><fieldset id='k7uFb'></fieldset></dl></div>
      • <bdo id='k7uFb'></bdo><ul id='k7uFb'></ul>
    2. <tfoot id='k7uFb'></tfoot>

      <small id='k7uFb'></small><noframes id='k7uFb'>

        数据绑定文本框:无法退出

        时间:2023-06-08

          <bdo id='pOQ2Z'></bdo><ul id='pOQ2Z'></ul>

                <tbody id='pOQ2Z'></tbody>
            • <tfoot id='pOQ2Z'></tfoot>
                  <i id='pOQ2Z'><tr id='pOQ2Z'><dt id='pOQ2Z'><q id='pOQ2Z'><span id='pOQ2Z'><b id='pOQ2Z'><form id='pOQ2Z'><ins id='pOQ2Z'></ins><ul id='pOQ2Z'></ul><sub id='pOQ2Z'></sub></form><legend id='pOQ2Z'></legend><bdo id='pOQ2Z'><pre id='pOQ2Z'><center id='pOQ2Z'></center></pre></bdo></b><th id='pOQ2Z'></th></span></q></dt></tr></i><div id='pOQ2Z'><tfoot id='pOQ2Z'></tfoot><dl id='pOQ2Z'><fieldset id='pOQ2Z'></fieldset></dl></div>

                  <small id='pOQ2Z'></small><noframes id='pOQ2Z'>

                1. <legend id='pOQ2Z'><style id='pOQ2Z'><dir id='pOQ2Z'><q id='pOQ2Z'></q></dir></style></legend>
                  本文介绍了数据绑定文本框:无法退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个文本框绑定到表单上的对象属性(实际上是几个文本框).这是一个对象的编辑器.当我在其中一个文本框中编辑一些对象并修改值时,我无法退出文本框(既不能通过选项卡也不能单击另一个文本框).然而,情况并非总是如此 - 当编辑其他对象(相同类型)时,它可以正常工作.

                  I've got a text box bound to an object's property (in fact several text boxes) on a form. This for is an editor for an object. When i'm editing some objects and modify values in the one of the text boxes i can't exit from the text box (neither by tab nor clicking on another text box). However that's not always the case - when editing other objects (of the same type) it works fine.

                  这是一个代码片段:

                  txtValue.DataBindings.Add("Text", _SourceObject, "PlannedValue", True, DataSourceUpdateMode.OnPropertyChanged, Nothing, "c")
                  txtEstPlacements.DataBindings.Add("Text", _SourceObject, "EstimatedPlacementCount")
                  txtReference.DataBindings.Add("Text", _SourceObject, "Reference")
                  

                  有什么建议吗?

                  推荐答案

                  听起来像是数据验证问题.检查表单上的控件是否将其 CausesValidation 属性设置为 true 或 false.

                  Sounds like a data validation issue. Check if the controls on the form have their CausesValidation properties set to true or false.

                  还要检查表单上的 AutoValidate 属性.它可能设置为 EnablePreventFocusChange(这是默认设置).

                  Also check the AutoValidate property on the form. It is probably set to EnablePreventFocusChange (which is the default).

                  也可能是文本框中提供的值无法转换为它在源数据对象上绑定的属性的类型.我相信 Convert 类用于此目的(尽管我在这里可能错了).

                  It may also be the case that the value being supplied in the text box can not be converted to the type of the property it is bound to on the source data object. I believe the Convert class is used for this (though I may be wrong here).

                  您可能想查看 MSDN 上的这篇文章winforms 验证的一些细节.

                  You may want to check out this article on MSDN that covers winforms validation in some detail.

                  这篇关于数据绑定文本框:无法退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Windows 窗体中的文本框验证 下一篇:如何在 ASP 文本框中显示会话值

                  相关文章

                  • <bdo id='7YQvx'></bdo><ul id='7YQvx'></ul>

                  <small id='7YQvx'></small><noframes id='7YQvx'>

                    <legend id='7YQvx'><style id='7YQvx'><dir id='7YQvx'><q id='7YQvx'></q></dir></style></legend>
                    <tfoot id='7YQvx'></tfoot>
                    <i id='7YQvx'><tr id='7YQvx'><dt id='7YQvx'><q id='7YQvx'><span id='7YQvx'><b id='7YQvx'><form id='7YQvx'><ins id='7YQvx'></ins><ul id='7YQvx'></ul><sub id='7YQvx'></sub></form><legend id='7YQvx'></legend><bdo id='7YQvx'><pre id='7YQvx'><center id='7YQvx'></center></pre></bdo></b><th id='7YQvx'></th></span></q></dt></tr></i><div id='7YQvx'><tfoot id='7YQvx'></tfoot><dl id='7YQvx'><fieldset id='7YQvx'></fieldset></dl></div>