Have to click twice to see graphics - SOLVED lazarus / 39-Graphics ---------------------------------------------------------------------- RuudB · 2014-07-12 19:29 Hello, So far I never programmed graphics. I have a form with buttons that each open other forms. I decided hat one must show a map I drawned using info extracted from a file. If I put the commands in "FormCreate" and/or "FormShow" and push the button, nothing happens. I placed an Edit field on the form and a line telling to alter the standard text works fine. When putting the commands in FormActivate and pushing the button, the form pops up with the altered Edit field. After pushing the button the second time, the graphics is added. I hope you understood the above. What am I doing wrong? Where should I initialize the graphics? FYI: the above triggered me to put the routines in the main form. Same result: I have to click twice before the graphics appear. Many thanks in advance! Kind regards, Ruud Baltissen ---------------------------------------------------------------------- Mike.Cornflake · 2014-07-12 19:39 Off the top of my head I can't remember if TForm has an OnPaint, but if it does thats wheree your drawing code should go.. ---------------------------------------------------------------------- taazz · 2014-07-13 02:06 show some code. you have left out so many details that is not even interesting to start looking. ---------------------------------------------------------------------- RuudB · 2014-07-13 06:41 Quote from: Mike.Cornflake on July 12, 2014, 09:39:23 pmOff the top of my head I can't remember if TForm has an OnPaint, but if it does thats wheree your drawing code should go..BINGO! Strange, I read various documents about how to program graphics but none mentioned OnPaint. Thank you very much! Kind regards, Ruud Baltissen ---------------------------------------------------------------------- RuudB · 2014-07-13 06:43 Quote from: taazz on July 13, 2014, 04:06:27 amshow some code. you have left out so many details that is not even interesting to start looking.Thank you for Answering but Mike alrady solved the problem. Kind regards, Ruud Baltissen