procedure TMyWin.HandleButtonEdit(var Msg: TMessage);
var
   SelectedItem : integer;
   pStr : pStrType;
begin
     SelectedItem := LB^.GetSelIndex;
     if (LB^.GetSelString(pStr,2) > 0) then
        begin
             Findith(CheckBook, SelectedItem + 1);
             Retrieve(CheckBook, gCheck);
             if (Application^.ExecDialog(New(PMyDialog, Init(@Self,'Check_Info'))) = id_OK) then
                begin
                     Update(CheckBook, gCheck);
                     RedoListBox;
                     isDirty := true;
                end;
        end
     else
         MessageBox(HWindow,'Please select an item first','Warning',mb_OK + mb_IconStop);
end;