ImageEn, unit iemview

TIECheckboxClickEvent

TIECheckboxClickEvent


Declaration


type TIECheckboxClickEvent = procedure(Sender: TObject; idx: integer; var bChecked : Boolean) of object;


Description


Occurs whenever a user clicks a checkbox.

idx is the index of the clicked image.
bChecked specifies the new status of the image. You can override it, e.g. set it to false if the image cannot be checked

Note: Don't read CheckedCount in this event which will not yet be valid. Use OnClick or OnMouseUp.


Example


procedure TfMain.ImageEnMView1CheckboxClick(Sender: TObject; idx: integer; var bChecked : Boolean);
begin
  // Only allow JPEG images to be checked
  if bChecked and (IEFileIsOfFormat(ImageEnMView1.ImageFilename[idx], ioJPEG) = False) then
  begin
    MessageBeep(MB_ICONEXCLAMATION);
    bChecked := False;
  end;
end;


See Also


- Checkboxes
- CheckedCount