Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy custom control task pane does not update its properties?
    text
    copied!<p>I have designed a custom panel which can expand or collapse form at run time. <img src="https://i.stack.imgur.com/UmHO4.png" alt="enter image description here"></p> <p>When I change its height from custom designed task, it does not update it. <img src="https://i.stack.imgur.com/SPXiV.png" alt="enter image description here"></p> <p>Code of my control class:</p> <pre><code>using System; using System.Windows.Forms; using System.ComponentModel; using System.ComponentModel.Design; using System.Windows.Forms.Design; [Designer(typeof(MyControlDesigner))] public partial class ExpandCollapsePanel : UserControl { private bool flag = false; private Size size; public int usrVerticalSize; public ExpandCollapsePanel() { InitializeComponent(); } [DefaultValueAttribute(true)] public int SetVerticalSize { get { return usrVerticalSize; } set { usrVerticalSize = value; } } </code></pre> <p>Code of taskpanedesign class:</p> <pre><code>namespace ExpandCollapseFormLibrary { class CustomDialogue : ControlDesigner { private DesignerActionListCollection actionLists; public override DesignerActionListCollection ActionLists { get { if (actionLists == null) { actionLists = new DesignerActionListCollection(); actionLists.Add(new MyActionListItem(this)); } return actionLists; } } } internal class MyActionListItem : DesignerActionList { public MyActionListItem(ControlDesigner owner) : base(owner.Component) { } public override DesignerActionItemCollection GetSortedActionItems() { var items = new DesignerActionItemCollection(); //items.Add(new DesignerActionTextItem("Hello world", "Misc")); items.Add(new DesignerActionPropertyItem("Checked", "Vertical Drop Down Size")); return items; } public int Checked { get { return ((ExpandCollapsePanel)base.Component).SetVerticalSize; } set { ((ExpandCollapsePanel)base.Component).SetVerticalSize = value; } } } } </code></pre> <p>When I change the value the Form1(where drag and dropped) designed class keep it permanently. <img src="https://i.stack.imgur.com/EQjCh.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload