Recent

Author Topic: How to make a tooltip?  (Read 8758 times)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
How to make a tooltip?
« on: April 15, 2008, 07:30:37 am »
What's the component to create it? I've tried PopupNotifier but it looks ugly.
(http://img149.imageshack.us/img149/6106/tooltipsm4.th.png)

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
RE: How to make a tooltip?
« Reply #1 on: April 15, 2008, 10:20:26 am »
See properties Hint and ShowHint of TControl descendants.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
RE: How to make a tooltip?
« Reply #2 on: September 05, 2008, 06:23:20 am »
Sorry for re-opening old topic. The one showed by Hint property is different from Windows' standard tooltip (rounded rectangle, fade-in effect, icons, etc.). I need to restrict input in an TEdit to numbers, so I declare this:
Code: [Select]

procedure TMainForm.Edi1KeyPress(Sender: TObject; var Key: Char;
const
  Enter = #13;
  Backspace = #8;
  Del = #46;
begin
  if not(Key in [Enter,Backspace,Del,'0'..'9']) then begin
    Key:=#0; // override to "nothing"
    // Show a tooltip saying something like: "only numbers are allowed!" (with (X) icon if possible)
  end;
end;

I need to fill that code. But how? Cross-platform solution, please... under WinAPI, I can simply call CreateWindowEx with proper arguments.

 

TinyPortal © 2005-2018