Recent

Author Topic: FormIcon disable, how?  (Read 2552 times)

McLion

  • New Member
  • *
  • Posts: 17
FormIcon disable, how?
« on: March 31, 2015, 10:46:07 am »
FormIcon disable, how to do that?

Thx

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: FormIcon disable, how?
« Reply #1 on: March 31, 2015, 10:52:32 am »
Code: [Select]
procedure TForm1.FormCreate(Sender: TObject);
begin
  BorderStyle:=bsSizeToolWin;
end;

McLion

  • New Member
  • *
  • Posts: 17
Re: FormIcon disable, how?
« Reply #2 on: March 31, 2015, 10:55:49 am »
My BorderStyle is already set.

Code: [Select]
BorderStyle:=bsSingle;

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FormIcon disable, how?
« Reply #3 on: March 31, 2015, 11:20:29 am »
If you set BorderStyle to one other than Sizeable and Single, the icon does not appear on caption bar.

McLion

  • New Member
  • *
  • Posts: 17
Re: FormIcon disable, how?
« Reply #4 on: March 31, 2015, 11:26:20 am »
Is that maybe the other way?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FormIcon disable, how?
« Reply #5 on: March 31, 2015, 11:50:03 am »
I don't think so.

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: FormIcon disable, how?
« Reply #6 on: March 31, 2015, 12:02:05 pm »
Is using a blanc application-icon an option?

And there is an option to use another (blanc) icon other than the application icon per form.
(i.e. You could try assigning a blanc icon to Self.Icon of your form)

See code below (however it would be more flexible to use a resource instead of icon-file but this is just to illustrate it is possible):
Code: [Select]
procedure TForm1.FormCreate(Sender: TObject);
var
  MyBlancIcon: TIcon;
begin
  MyBlancIcon := TIcon.Create;
  try
    MyBlancIcon.LoadFromFile('c:\temp\blanc.ico');
    Self.Icon.Assign(MyBlancIcon);
  finally
    MyBlancIcon.Free;
  end;
end;

(Note: This just disables the visible part of the formicon. It doesn't disable the formmenu. If you want that you should take extra steps.)
« Last Edit: March 31, 2015, 12:14:24 pm by rvk »

 

TinyPortal © 2005-2018