Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

setting a checkbox checked value through code

edited September 2001 in General
hello,
im trying to set the checked property on a checkbox through code with the
following code:

evalReport.ObjectByName(bandIndex, objectIndex, 'gpwsCheckbox');
lObject := evalReport.bands[bandindex].objects[objectIndex];
lObject.checked := true;

but when i compile it does not recognize the checked property. Do i need to
cast lObject to a TmyCheckbox before i can set the value? if so how do a
cast?

thanks

matt

Comments

  • edited September 2001
    > evalReport.ObjectByName(bandIndex, objectIndex, 'gpwsCheckbox');

    if Assigned(lObject) and (lObject is TppCheckBox) then
    TppCheckBox(lObject).Checked := True;

    or whatever the class name is (eg. TmyCheckBox )

    Note that this will not work for a db checkbox.

    Ed Dressel
    to
This discussion has been closed.