Recent

Author Topic: [SOLVED] Odd behavior with icons in a dialog window  (Read 993 times)

EganSolo

  • Sr. Member
  • ****
  • Posts: 395
[SOLVED] Odd behavior with icons in a dialog window
« on: June 27, 2025, 01:18:06 am »
I have a .ico file housing icons sized from 16x16 thru 256x256.
Loading this file into the icon property works without a hitch.
Loading it in the icon property of dialog forms fail. By this, I mean that the loading works just fine, but when I click on the button to view the icon, the editor comes up empty.

What am I doing wrong?
« Last Edit: June 27, 2025, 11:55:51 pm by EganSolo »

ASerge

  • Hero Member
  • *****
  • Posts: 2481
Re: Odd behavior with icons in a dialog window
« Reply #1 on: June 27, 2025, 05:25:14 am »
What am I doing wrong?
You don't show the code :)

EganSolo

  • Sr. Member
  • ****
  • Posts: 395
Re: Odd behavior with icons in a dialog window
« Reply #2 on: June 27, 2025, 08:43:53 am »
My bad, ASerge, please find included a simple project that illustrates the problem.

The icon I want to add is Action.ico When you run the program, you should see the main form looking like in the first image. Then, when you press on the button "Show Dialog" you should see the dialog as in the second image.


tetrastes

  • Hero Member
  • *****
  • Posts: 761
Re: Odd behavior with icons in a dialog window
« Reply #3 on: June 27, 2025, 09:29:36 am »
Form2 property BorderStyle is bsDialog. Forms of this style don't show icon at windows.

ASerge

  • Hero Member
  • *****
  • Posts: 2481
Re: Odd behavior with icons in a dialog window
« Reply #4 on: June 27, 2025, 09:45:41 am »
Set the BorderStyle to bsSingle to display the icon.

EganSolo

  • Sr. Member
  • ****
  • Posts: 395
Re: [SOLVED] Odd behavior with icons in a dialog window
« Reply #5 on: June 27, 2025, 11:56:20 pm »
Thanks guys!
Much appreciated!

 

TinyPortal © 2005-2018