Lazarus

Programming => General => Topic started by: Firewrath on August 09, 2018, 07:47:28 pm

Title: How can I make a label 'Click through'? & Taskbar removal question
Post by: Firewrath on August 09, 2018, 07:47:28 pm
Hello. I did not expect to be around today, but since I am, I have two quick questions:

I am using code from 'Lazplanet: Dragging a Form by its body (http://lazplanet.blogspot.com/2013/06/dragging-form-by-its-body.html)' to drag a form around. This form has a label with text on it. If I click the label, I can no longer drag the form.
Is there any way to make my 'click' go through to the form past the label?
Currently if the label is set to 'disabled', I can click on it and the 'click' passes through to the form just fine, the problem with that is the text on the label is then greyed-out and hard to see.
I have tried this with just a text element with the same results, it also blocks my mouse clicks.
Unfortunately, since I was not expecting to be able to post today, I do not have actual code to show this or I would have provided a better example. -_-


Second issue, this does not work:
Code: Pascal  [Select][+][-]
  1. Form1.ShowInTaskBar := stNever;
I have it placed in my forms 'OnCreate' section, but still have the taskbar icon/text.
(I'm on WindowsXP)
Does anyone know of a way to remove my program from the taskbar?
I plan on having it accessible from the system tray.

Thanks ahead of time for any help offered.
Title: Re: How can I make a label 'Click through'? & Taskbar removal question
Post by: Zath on August 09, 2018, 07:58:39 pm
The easiest way for the first part would be to select the label component and set its OnMouseDown and OnMouseOver events to point to the same code as the form.
Title: Re: How can I make a label 'Click through'? & Taskbar removal question
Post by: Firewrath on August 09, 2018, 08:07:02 pm
I tried that, it didn't seem to work. I shall give it another go tonight.
Looking at the page again I see there is also:
Code: Pascal  [Select][+][-]
  1. Form1.Left := Form1.Left + (X - PX);
  2. Form1.Top := Form1.Top + (Y - PY);
instead of:
Code: Pascal  [Select][+][-]
  1. SetBounds(Left + (X - PX), Top + (Y - PY), Width, Height);
so maybe Form1.Left & Top would work better on the Label then SetBounds.
Title: Re: How can I make a label 'Click through'? & Taskbar removal question
Post by: ASerge on August 10, 2018, 09:28:31 pm
Is there any way to make my 'click' go through to the form past the label?
...
Does anyone know of a way to remove my program from the taskbar?
1. Tip @Zath correct, should work.
2. See hiding main window's taskbar button on windows (http://forum.lazarus.freepascal.org/index.php?topic=11236.0).
TinyPortal © 2005-2018