C1Editor throws error when added to working project

Posted by: cvandien on 22 March 2019, 1:48 pm EST

    • Post Options:
    • Link

    Posted 22 March 2019, 1:48 pm EST

    Hello,

    Love the tools, big fan of Component One

    I have an existing (working) project that requires the C1Editor.

    The project is a MDI interface, all Forms are Child of this MDI form…

    I am adding the ToolStripContainer, ToolStripMain (in the Panel section) and the Editor in the Panel Content section - just like the QuickStart example - on to an existing Form.

    When The Editor is present (I have deleted the added controls one by one to find that it is the Editor control that is the control causing the error…) I get the following error, that points to the line of the code pasted…

    I have tried a number of ways to instantiate the Form… with no success. Again, the error points to the form that is NOT (Me) - so I am at a loss to reconcile this… needing some help.

    I’m assuming there is some convention with Compnent One, Winforms, C1Editor that I am not conforming to (some internal requirement that VB is otherwise fine with when the Editor is NOT present…) but it is beyond me.

    If someone can help, that would be great.

    The error:

    The form referred to itself during construction for a different instance, which led to an infinite recursion. Within the Forms Constructor refer to the form using ‘Me’

    The failing line (section)

    With Communication 'this is the error’d line… this is NOT the ‘Me’ form

    .MdiParent = Me

    .Tag = String.Empty

    .Show()

    MDIMenu_CommunicationNew.Enabled = False

    End With

  • Posted 25 March 2019, 7:48 am EST

    No replies for this?

  • Posted 25 March 2019, 9:14 am EST

    Hello,

    Thank you for explaining the scenario.

    Though, it is not completely clear from the code snippet why the error might be occurring. Looking at the error message it looks like you are referring the Me form before it has actually been created. Please try assigning the MdiParent inside Load event instead of constructor.

    Also, please make sure to not refer the form by their name but instance it and pass the main form reference.

    Like if your form is ‘Communication’ then in the constructor, modify the code from ‘Communication’ to ‘Me’

    If the above suggestions do not help, we would need more code snippet (or your stripped down application) to further investigate the matter.

    Thanks,

    Ruchir

Need extra support?

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

Learn More

Forum Channels