none
creating connector designer control ?? RRS feed

  • Question

  • Hi,

    I am developing runtime editable control in C# where the controls will be added during runtime,but now I am stuck to create connector control.

    The connector I mean is like we usually get in workflow or visio connecting two components.

    Please help me if you can refer to me the correct solution.

    Thanks


    Best Wishes !!
    Friday, May 15, 2009 3:52 PM

Answers

  • Getting a control to behave like a line is very difficult.  A control always has a window associated with it and a window is always rectangular.  Which works sorta okay for vertical and horizontal lines, but not for diagonal ones.  Now you're battling a z-order problem where the window with the line is on top of other controls, hiding them.

    Look at the Visual Basic PowerPack controls, included with .NET 3.5 SP1.  It has a slick LineShape component.  It is a component, not a control, thus doesn't have the window problem.  It took Microsoft quite a while to produce this component, there was long a strong request for them because VB6 had one.  It took them several years to come up with the designer code needed to make this component work well in the designer.  You probably just want to use this component as-is.

    Hans Passant.
    • Marked as answer by Fey __ Tuesday, May 19, 2009 2:59 AM
    Friday, May 15, 2009 4:05 PM
    Moderator
  • I understood.  My answer is valid.

    Hans Passant.
    • Marked as answer by Fey __ Sunday, May 17, 2009 1:41 PM
    Saturday, May 16, 2009 9:51 AM
    Moderator

All replies

  • Getting a control to behave like a line is very difficult.  A control always has a window associated with it and a window is always rectangular.  Which works sorta okay for vertical and horizontal lines, but not for diagonal ones.  Now you're battling a z-order problem where the window with the line is on top of other controls, hiding them.

    Look at the Visual Basic PowerPack controls, included with .NET 3.5 SP1.  It has a slick LineShape component.  It is a component, not a control, thus doesn't have the window problem.  It took Microsoft quite a while to produce this component, there was long a strong request for them because VB6 had one.  It took them several years to come up with the designer code needed to make this component work well in the designer.  You probably just want to use this component as-is.

    Hans Passant.
    • Marked as answer by Fey __ Tuesday, May 19, 2009 2:59 AM
    Friday, May 15, 2009 4:05 PM
    Moderator
  • Hi Hans,

    Thanks for your reply, may be my explaination was not good. we are designing a application where all the components will be in toolbox in runtime. which we achieved by using label/button now we want some kind of connection look like component or control between these labels/buttons. like visual studio typed dataset / table adapter uses to show connection between 2 tables. if there is something in .net please help me.
    Best Wishes !!
    Saturday, May 16, 2009 2:51 AM
  • I understood.  My answer is valid.

    Hans Passant.
    • Marked as answer by Fey __ Sunday, May 17, 2009 1:41 PM
    Saturday, May 16, 2009 9:51 AM
    Moderator