Editor control bug when set text property?

Posted by: pauld on 16 April 2018, 8:18 pm EST

    • Post Options:
    • Link

    Posted 16 April 2018, 8:18 pm EST

    We have a form that allows a user to enter notes text into a C1Editor control OR a C1TextBox control, depending on the selected value of a combo control.

    When the user selects a value from the combo and presses the tab key, the editor control OR the textbox control is appropriately dis/enabled and shown/hidden based on the selected value in the combo.

    Note that this code also keeps the “raw” text of the editor control and the textbox “in sync” so that, if the user switches between the editor control and the textbox, or vice versa, the text from the prior edit control will be preserved.

    However, after tabbing off the combo control, sometimes focus is inappropriately set to the C1Editor control. When we trace the code, we find that assigning a value to the C1Editor.Text property changes the environment’s ActiveControl to the C1Eeditor control - NOT what we want. That interrupts the normal flow of the tab order.

    This does not seem like appropriate behavior.

    Can you please verify that this is a bug/not?

    Thanks.

    – Paul

  • Posted 17 April 2018, 7:19 am EST

    Hi Paul!

    Thanks for sharing your observations with us. I tried to recreate the scenario as per the details, but could not replicate the problem. Can you please modify the sample below, to show the issue?

    Prj_EditorTextChange.zip

    Also, I need to know the exact steps to be followed along with build version and system environment details at your end. Once the issue is replicated at my end too, I can do the needful.

    Best regards,

    Meenakshi

  • Posted 17 April 2018, 1:26 pm EST

    Meenakshi,

    Thanks for the response and the test project.

    However, I don’t need to modify your project to allow you to see the problem; the same problem but triggered differently than my original post.

    In your project, the C1Editor gets focus just by being made visible.

    To see the issue:

    1. Put a break on the code line: c1Editor1.Visible = true;
    2. Run the project in debug mode.
    3. Choose the combo option: “Hide Editor”
    4. Tab off the combo and

      a) The editor control disappears, as expected.

      b) Focus moves to “button1”, as expected.
    5. Choose the combo option: “Show Editor”
    6. Tab off the combo and examine what happens to the ActiveControl as the editor is made visible.

    Before the editor is made visible, the ActiveControl is “button1”.

    After the editor is made visible, the ActiveControl is “c1Editor1”.

    I realize this is somewhat different from my original issue, but it’s still a problem.

    And, I am going to modify you project to try and recreate the problem when the text property is changed also.

    Thanks.

    – Paul

  • Posted 19 April 2018, 12:26 am EST

    Hi Paul!

    I am able to see the issue, by following these steps. Hence, this issue is being escalated to the concerned team [Internal ID : 318085].

    We will inform you once it is resolved.

    Meanwhile, as its workaround, you can try saving ActiveControl before setting C1Editor.Visible property to true (or any other operation that is responsible for changing ActiveControl value to C1Editor). And after execution of such operation, you can set ActiveControl property to the saved value.

    Hope this helps you.

    Best regards,

    Meenakshi

  • Posted 11 April 2020, 7:45 am EST

    Hi,

    We are sorry to let you know that this is a limitation. Underlying control steals the focus on every document load.

    Workaround can be to set C1Editor.Enabled to false and restore it to True in Form1.Shown event.

    ~Regards,

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels