* * *

Author Topic: How can I make a label 'Click through'? & Taskbar removal question  (Read 319 times)

Firewrath

  • New member
  • *
  • Posts: 10
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' 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.
« Last Edit: August 09, 2018, 07:49:10 pm by Firewrath »
Sorry. I currently don't have Internet Access. So my replies might take a week. -_-

Zath

  • Sr. Member
  • ****
  • Posts: 292
Re: How can I make a label 'Click through'? & Taskbar removal question
« Reply #1 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.

Firewrath

  • New member
  • *
  • Posts: 10
Re: How can I make a label 'Click through'? & Taskbar removal question
« Reply #2 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.
Sorry. I currently don't have Internet Access. So my replies might take a week. -_-

ASerge

  • Hero Member
  • *****
  • Posts: 942
Re: How can I make a label 'Click through'? & Taskbar removal question
« Reply #3 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.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus