Recent

Author Topic: main form cant change background color  (Read 5106 times)

ronhud

  • Jr. Member
  • **
  • Posts: 84
main form cant change background color
« on: December 09, 2021, 11:54:29 am »
I have just updated my Lazarus IDE to version 2.2 ORC1.  In one of my programs the main form had a white background but since the update it has become grey and assigning clWhite to the Form object seems to have no effect.  I have searched this forum without finding a solution - yet I cant think I am the only one to encounter this.

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: main form cant change background color
« Reply #1 on: December 09, 2021, 12:13:49 pm »
Cannot reproduce this:
- New project
- Set value of Form1.Color in object inspector to clRed --> Background becomes red as expected (Win 11, Laz 2.2RC2)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: main form cant change background color
« Reply #2 on: December 09, 2021, 12:28:54 pm »
I have just updated my Lazarus IDE to version 2.2 ORC1.  In one of my programs the main form had a white background but since the update it has become grey and assigning clWhite to the Form object seems to have no effect.  I have searched this forum without finding a solution - yet I cant think I am the only one to encounter this.

If that is under program control (i.e. rather than in the IDE) please append an example that people can run, and also say what OS etc. you're using.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

ronhud

  • Jr. Member
  • **
  • Posts: 84
Re: main form cant change background color
« Reply #3 on: December 09, 2021, 02:16:31 pm »
I apologise for not doing the simple test before raising the problem.  I have created a new project and can change the form background colour.   I need to look again at the program with the problem however under the previous version of the IDE it performed as expected and after the update (with nothing to do with the form having changed ) it acted differently.  I will report back if/when I find the cause.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: main form cant change background color
« Reply #4 on: December 09, 2021, 02:35:40 pm »
Make sure that you've not put a control on the form which is taking the entire client space, including having the form auto-size. And beware of frames.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

ronhud

  • Jr. Member
  • **
  • Posts: 84
Re: main form cant change background color
« Reply #5 on: December 09, 2021, 04:04:30 pm »
Well... sequence of events:-
Development is on pc the application copied to laptop

Updated my version of Lazarus
Compiled an existing application
Main Form back ground colour grey - should be white, checked in the object inspector- correctly defined as clWhite.
Made simple test showing just a  main form - correctly displayed as white.
Recompiled my application and it correctly displayed as white
copied the application exe to my laptop displayed as grey.
Made a new simple application with a label and button and it displayed correctly as white
recompiled my original application
copied to laptop correctly displayed as white.

So I have a succesfull outcome but no idea how!

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: main form cant change background color
« Reply #6 on: December 09, 2021, 04:21:53 pm »
The only thing I can suggest is that since the object (i.e. between compiler and linker) files are marked with the FPC version but not the Lazarus version, there was something in your app which hadn't been recompiled.

I suggest that if you see anything even vaguely inexplicable again you do BOTH a "Clean directory" and a "Build".

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

ronhud

  • Jr. Member
  • **
  • Posts: 84
Re: main form cant change background color
« Reply #7 on: December 09, 2021, 05:05:52 pm »
Thank you for the reminder about clean and build.

 

TinyPortal © 2005-2018