Hi Jacob,
I had the same problem, maybe someone else can shed some light on
this....
in the meantime, I have been able to get ISelectionService to work.
Is this how your doing it?
DesignerVerb verbTestOn;
DesignerVerb verbTestOff;
public override initialize(IComponent component)
{
verbTestOn = new DesignerVerb("Test On",new EventHandler(TestOn));
verbTestOff = new DesignerVerb("Test Off",new
EventHandler(TestOff));
Verbs.Add(verbTestOn);
}
private void TestOn(object sender, EventArgs e)
{
Verbs.Remove(verbTestOn);
Verbs.Add(verbTestOff);
ISelectionService ss =
(ISelectionService)GetService(typeof(ISelectionService));
ss.SetSelectedComponents(new IComponent[] { this.Control.Parent }
);
ss.SetSelectedComponents(new IComponent[] { this.Control } );
}
private void TestOff(object sender, EventArgs e)
{
Verbs.Add(verbTestOn);
Verbs.Remove(verbTestOff);
ISelectionService ss =
(ISelectionService)GetService(typeof(ISelectionService));
ss.SetSelectedComponents(new IComponent[] { this.Control.Parent }
);
ss.SetSelectedComponents(new IComponent[] { this.Control } );
}
kind regards
Jerron
> Thank you for your great answer, but it's a solution to a little bit
> different problem. I've had no problems, enabling/disabling and setting the
[quoted text clipped - 242 lines]
> >> >
> >> > }
Jacob - 28 Oct 2004 06:29 GMT
Thanks for the suggestion but I've tried the ISelectionService approach that
you suggested. It works in your instance where it's a verb that is being
invoked, but not in my instance where a property is changing in the property
grid. Amazingly doing the exact same thing that you've suggested here won't
work if you put it in a IComponentChanged event handler.
Jacob
> Hi Jacob,
>
[quoted text clipped - 309 lines]
>> >> >
>> >> > }