[SOLVED] TImage icon not shown lazarus / 21-General ---------------------------------------------------------------------- cris75 · 2022-10-21 16:28 Hi, I'm going nuts.. I'm  trying to load an icon from Lazarus ide resources on the form cFrm without success.. (I mean the icon is not where it is supposed to be on the form at runtime) Am I missing the obvious?! Maybe I'm tired.. Here is my code sample: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.CustMsg(pWidth, aTop, aLeft, aWidth: Integer;  aCaption: string);var  cFrm   : TForm;  cOk    : TBitBtn;  cImg   : TImage;  png    : TPortableNetworkGraphic;  vStream: TResourceStream;begin  cFrm                     := TForm.Create(nil);  cFrm.BorderIcons           := cFrm.BorderIcons - [biMinimize, biMaximize];  cFrm.Constraints.MaxHeight := 110;  cFrm.Constraints.MaxWidth  := aWidth;  cFrm.Constraints.MinHeight := 110;  cFrm.Constraints.MinWidth  := aWidth;  cFrm.Top                   := aTop;  cFrm.Left                := aLeft + (pWidth - aWidth) div 2;  cFrm.Width                 := aWidth;  cFrm.Height                := 110;  cFrm.Constraints.MinWidth  := 200;  cFrm.Caption               := aCaption;  cImg                       := TImage.Create(cFrm);  png:= TPortableNetworkGraphic.Create;    try    vStream := TResourceStream.Create(HINSTANCE,'EXMARK', RT_RCDATA);    try      Png.LoadFromStream(vStream);      cImg.Picture.Assign(png);    finally      vStream.Free;    end;  finally    Png.Free;  end;    cImg.Left:= 30;  cImg.Top:= 30;  cImg.AutoSize:= TRUE;   cOk                      := TBitBtn.Create(cFrm);  cOk.Parent                 := cFrm;  cOk.Top                    := 70;  cOk.Kind                   := bkOK;  cOk.Left                   := cFrm.Width - (cOK.Width+12);   cFrm.ShowModal;  cFrm.Free;end; ---------------------------------------------------------------------- Nicole · 2022-10-21 17:08 Do you think, you can make a screenshot of what you get? And make a second image by an imageditor what you expect to get? ---------------------------------------------------------------------- winni · 2022-10-21 17:25 Quote from: cris75 on October 21, 2022, 06:28:47 pm Am I missing the obvious?! Maybe I'm tired.. Hi Yes, you are tired .... You forget to assign the form as parent for the Image. Thats the secret. Winni ---------------------------------------------------------------------- cris75 · 2022-10-21 19:36 thank you very much winni!  Guess who'll go to sleep soon this evening..?!?  Good night! ---------------------------------------------------------------------- Nicole · 2022-10-22 11:42 To my mind, the story of a programmer sitting until deep in the night with a huge mug of coffee, is just a story. The later the hour, the blinder I become. There is nothing which can increase the progress in the late evening. Only the time is lost. At least for me. ---------------------------------------------------------------------- J-G · 2022-10-22 12:41 Quote from: Nicole on October 22, 2022, 01:42:32 pmTo my mind, the story of a programmer sitting until deep in the night with a huge mug of coffee, is just a story. The later the hour, the blinder I become. There is nothing which can increase the progress in the late evening. Only the time is lost. At least for me. Your problem is the choice of beverage  I tend to do my best work between midnight & 3am - - -  fuelled by TEA  🥳​ ---------------------------------------------------------------------- cris75 · 2022-10-22 13:24 Wow..! Am I going mad..? I remember perfectly I marked the topic solved yesterday.. where is it gone the [SOLVED] marking?? ---------------------------------------------------------------------- dsiders · 2022-10-22 17:15 Quote from: cris75 on October 22, 2022, 03:24:51 pmWow..! Am I going mad..? I remember perfectly I marked the topic solved yesterday.. where is it gone the [SOLVED] marking??  It has to be marked as "Solved" on the first topic in the thread. I think...