Thanks Matt
 
I was wondering about that overnight.  I was going to try a EndDrag before doing the Free.  That may work as well.  But I thought of a better way to do it.  I don't need to delete the checkbox and create another one.  I can use the Move method of the TList to change the position in the list.  I had forgotten this method existed.  I don't use TLists very often.
 
Cheers,
Ross.
----- Original Message -----
From: Matt Comb
Sent: Friday, October 01, 2004 5:48 AM
Subject: Re: [DUG] TCheckGroup

You can't delete this item at this stage as its used for other methods internally fired with the drag drop event. Instead try something like this:
 
1. replace oldcb.free with postmessage e.g.
postmessage(self.handle,wm_user+1,0,0);
 
2. Declare in the CheckGroup Object a new method receiving your message. e.g.
procedure DeleteSomething(var Message: TMessage); message WM_user+1;
 
3. Setup the Method and move the lines beneath the oldcb.free into it. e.g.
procedure TCheckGroup.DeleteSomething(var Message: TMessage);
begin
     if assigned(freeob) then begin
        freeandnil(freeob);
        ArrangeCheckBoxList;
        FUpdating := False;
    e
nd;
end;
 
Code not great but gives you the idea.
 
Matt.
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to