This is not an answer, but a tip...
I would:
1. add private variable to return
Accessibility
private bool bAcc = false;
2. add
Accessibility
property
public bool Accessibility => bAcc;
3. change
accessibility
method to
SetAccessibility
public void SetAccessibility(bool accessible)
{
bAcc = accessible;
if (bAcc)
{
Items.Clear();
Items.AddRange(itemList);
toolTip.SetToolTip(this, "");
}
else
{
Items.Clear();
toolTip.SetToolTip(this, msg);
}
}
4. and also add in constructor
public ZComboBox(bool accessible)
{
InitializeComponent();
bAcc = accessible;
}
which will help you to create custom combobox with predefined
Accessible
property in code.
[EDIT]
Another tip:
1. Change custom combobox properties (if you want)
2. Build project
3. Go to form design view,
4. Open Toolbox and drag & drop 2 zCombBox'es on that form,
5. Remove these lines from constructor:
zComboBox1 = new ZComboBox(new object[] { "1", "2" });
zComboBox2 = new ZComboBox(new object[] { "a", "b" });
5. Use
SetAccessibiity
method (in form constructor) to change Accessibility property
zComboBox1.SetAccessibility(false);
zComboBox2.SetAccessibility(true);
7. Run project (F5).
That's all!