Need help salvaging a form - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Need help salvaging a form

haz33haz33 Posts: 11Member

Hi,

I was developing a form using split containers within other split containers. I changed the name of one of the split containers and, after I did, I was no longer able to view the form in the .NET designer. Instead, I get an error page that says:

One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.


The two errors I received were:

A circular control reference has been made. A control cannot be owned by or parented to itself.

SplitterDistance must be between Panel1MinSize and Width - Panel2MinSize.


I made some adjustments to the designer code and that got rid of those two errors in the error list at the bottom of my screen. But when I attempt to view the form by clicking on it, I still get the error page with the two errors.

Someone please help. I'm hoping that I don't have to recreate the form's components from scratch. Any help would be greatly appreciated!

Comments

  • PavlinIIPavlinII Posts: 404Member
    :
    : Hi,
    :
    : I was developing a form using split containers within other split containers. I changed the name of one of the split containers and, after I did, I was no longer able to view the form in the .NET designer. Instead, I get an error page that says:
    :
    : One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.
    :
    :
    : The two errors I received were:
    :
    : A circular control reference has been made. A control cannot be owned by or parented to itself.
    :
    : SplitterDistance must be between Panel1MinSize and Width - Panel2MinSize.
    :
    :
    : I made some adjustments to the designer code and that got rid of those two errors in the error list at the bottom of my screen. But when I attempt to view the form by clicking on it, I still get the error page with the two errors.
    :
    : Someone please help. I'm hoping that I don't have to recreate the form's components from scratch. Any help would be greatly appreciated!
    :
    Hi,
    are you using .NET 1.1 or .NET 2.0? They differ in desing-data location, but I guess you've already find this.
    (.NET 1.1 - at the begining of FormName.vb file)
    (.NET 2.0 - in separate FormName.design.vb file)

    The schema of that desing-code part is clear. There are
    ControlName = New ControlClassname()
    and later, setting properties and owners. You'll have to track this part and find that cycle. It means:
    Let's say, you have 3 containers (panels, or some other control that can have child controls) named pa, pb, pc.
    me.pa=new...
    pb=new...
    pc=new..

    pa.controls.add(pb)
    pb.controls.add(pc)
    This means that pc is inside pb, and pb is inside pa. pa is direcly on form (like form.controls.add(pa)), and world is nice, no cycles are present.

    But if you append pc.controls.add(pa), you add cycle pa->pb->pc->pa and so on..

    Take that desing-part code and track changes and appending one control to another. I suggest you to draw control tree.
    You're looking for ANY cycle in this tree (there may exist much longer cycle that this triangle one).
    Removing any branch from this cycle will fix your problem. But be carefull which part are you removing to keep logical assignemt of containers..

    and finally, find all "SplitterDistance" properties and check their value.

    Make backup of your files before making changes! ;)

    Hope this helps

    [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]

    [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]


Sign In or Register to comment.