Recent

Author Topic: Icons for all forms  (Read 490 times)

domasz

  • Hero Member
  • *****
  • Posts: 541
Icons for all forms
« on: August 30, 2024, 03:21:26 pm »
How can I show icons on title bars in all forms not just the main form?
I set Icon property but it doesn't work.

Thaddy

  • Hero Member
  • *****
  • Posts: 15735
  • Censorship about opinions does not belong here.
Re: Icons for all forms
« Reply #1 on: August 30, 2024, 03:24:23 pm »
What does not work? If I do it here and refer to the proper ico resource it works.
Small example?
If I smell bad code it usually is bad code and that includes my own code.

domasz

  • Hero Member
  • *****
  • Posts: 541
Re: Icons for all forms
« Reply #2 on: August 30, 2024, 04:46:53 pm »
I have a Form1 and AboutDlg (TAboutDlg = class(TForm)).

I set an icon in Project -> Project Options.

I also set AboutDlg.ShowInTaskBar := stAlways;

In design time I set an icon for AboutDlg.Icon. When this window shows it doesn't have my icon on the task bar but instead just the default lazarus icon. It also doesn't have any icon in title bar.

Fred vS

  • Hero Member
  • *****
  • Posts: 3366
    • StrumPract is the musicians best friend
Re: Icons for all forms
« Reply #3 on: August 30, 2024, 04:54:00 pm »
Hello.

What graphic server do you use?
Wayland does not allow icons in title bar (nor position of forms on the screen).
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

domasz

  • Hero Member
  • *****
  • Posts: 541
Re: Icons for all forms
« Reply #4 on: August 30, 2024, 05:11:23 pm »
Windows 10

Hansvb

  • Hero Member
  • *****
  • Posts: 710
Re: Icons for all forms
« Reply #5 on: August 30, 2024, 05:44:16 pm »
Hi,
Menu, Project Options and then load Icon in the application settings should be enough.

You can override this for each form by loading an icon under Icon in the Object Inspector. Then you can show an icon per form.

domasz

  • Hero Member
  • *****
  • Posts: 541
Re: Icons for all forms
« Reply #6 on: August 30, 2024, 07:26:18 pm »
Thanks. I had to restart explorer but now it does work.

 

TinyPortal © 2005-2018