C1Combo: snap lines

WinForms

ComponentOne's WinForms controls

C1Combo: snap lines

  • rated by 0 users
  • This post has 1 Reply |
  • 0 Followers
  • Hi community,

    probably you noticed that the C1Combo control does not work well when trying to
    align it with labels etc. in the Windows Forms Designer. The purple horizontal
    line, which marks the text bottom line and is perfect for aligning labels,
    buttons, checkboxes etc in one line, is missing.

    The fix is quite easy: you need to create a "ControlDesigner" subclass, which
    overrides the property "SnapLines" and add a BaseLine at y=15:

    using System.Collections;
    using System.Windows.Forms.Design;
    using System.Windows.Forms.Design.Behavior;

    namespace C1.Win.C1List
    {
    public class C1ComboDesigner : ControlDesigner
    {
    public override IList SnapLines
    {
    get
    {
    IList snaplines = base.SnapLines;

    SnapLine snapBaseLine = new SnapLine(SnapLineType.Baseline, 15);
    snaplines.Add(snapBaseLine);

    return snaplines;
    }
    }
    }
    }

    This designer has to be activated on C1Combo:
    [DesignerAttribute(typeof(C1ComboDesigner ))]
    public class C1Combo : ...
    {


    That's all, and now the purple baseline is showing.

    I worked around it by adding a subclass of C1Combo to my project, but other
    users might find it useful, too. So I post it here, too.
  • Hello,
     
    This issue has been replicated as a situation with the control and has been escalated to the developers.
     
    Have a nice day.
     
    Regards,
    James Smith
    <Wolfgang Knauf> wrote in message news:218704@10.0.1.98...
    Hi community,

    probably you noticed that the C1Combo control does not work well when trying to
    align it with labels etc. in the Windows Forms Designer. The purple horizontal
    line, which marks the text bottom line and is perfect for aligning labels,
    buttons, checkboxes etc in one line, is missing.

    The fix is quite easy: you need to create a "ControlDesigner" subclass, which
    overrides the property "SnapLines" and add a BaseLine at y=15:

    using System.Collections;
    using System.Windows.Forms.Design;
    using System.Windows.Forms.Design.Behavior;

    namespace C1.Win.C1List
    {
    public class C1ComboDesigner : ControlDesigner
    {
    public override IList SnapLines
    {
    get
    {
    IList snaplines = base.SnapLines;

    SnapLine snapBaseLine = new SnapLine(SnapLineType.Baseline, 15);
    snaplines.Add(snapBaseLine);

    return snaplines;
    }
    }
    }
    }

    This designer has to be activated on C1Combo:
    [DesignerAttribute(typeof(C1ComboDesigner ))]
    public class C1Combo : ...
    {


    That's all, and now the purple baseline is showing.

    I worked around it by adding a subclass of C1Combo to my project, but other
    users might find it useful, too. So I post it here, too.

    http://helpcentral.componentone.com/cs/forums/p/79472/218704.aspx#218704

Page 1 of 1 (2 items)