it is an EVENT therefore it has to have a way of checking for it
You have three "it"s in that comment, and none of them has a clear referent.
it := Form because that is the main topic of the question at hand. I can see you are having trouble with statements with the word "it" in them. so let me rephrase that for you.
a Form has an Event of onHide attached to itself therefore there has to be a way of checking to see if that same Form is in fact in a show state or not. this would lead one to assume that it is a Boolean. Showing = true NotShowing=true.
Which ever state the Form is in then a true can be assigned to that state the form is in. therefore only to leave a false for the other state that this Form could be in. The form is either showing or not showing. The True or False would then be assigned to each state respectively in the option of the one that programmed the Form to have a return value of Boolean for each state the Form has been placed in.
The form being in a hidden state should have a true set to it somewhere. or at least a Boolean of true or false.
hows that no "IT's" in that statement. it is more words but says the same thing.
procedure LoadImageToVisibleForm;
var
r: TRect;
begin
if Form1.Visible then begin
r:=Rect(0, 0, Form1.Image1.Width, Form1.Image1.Height);
Form1.ImageList.StretchDraw(Form1.Image1.Canvas, Form1.ImageIndex, r)
end
else if Form2.Visible then
r:=Rect(0, 0, Form2.Image1.Width, Form2.Image1.Height);
Form1.ImageList.StretchDraw(Form2.Image1.Canvas, Form1.ImageIndex, r) ;
end;
your coding is correct in logic but it looks to not be Pascal, C perhaps.
else if Form2.Visible thenthat whole block statement of code of yours is in itself is a Boolean - yes or no - or - true or false
if Visible is true then do something
else
do something different // that is the false part of the Boolean
if you had read the last post just before yours you'd of seen that I already figured it out, and how.
Thank you anyways.