Bikin Baloon Tooltip Di Delphi, ini adalah source componentnya. soalnya aku ndak punya tempat buat upload component packgake nya, ya gini aja saya rasa udah cukup. kamu tinggal bikin aja component entar paste kan sourec ini. class nya pake class(TComponent),
benernya ini tips yang aku ambil dari torry.net cuman biar gampang jadi aku buat komponent, tinggal pasang jadi dech.
contoh penggunaan:
source komponen:
TooltipBaloon1.ShowBalloonTip(edit1,1,'Login','Masukan User Login Anda disini',clWhite,clBlue); TooltipBaloon1.ShowBalloonTip(edit2,'Password','Masukan Password Anda disini',clWhite,clBlue); |
source komponen:
unit TooltipBaloon; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, CommCtrl; type TTooltipBaloon = class(TComponent) private FxAuthor: ShortString; FxVersion: ShortString; procedure SetxAuthor(const Value: ShortString); procedure SetxVersion(const Value: ShortString); { Private declarations } protected { Protected declarations } public { Public declarations } constructor Create(AOwner : TComponent);override; destructor Destroy();override; procedure ShowBalloonTip(Control: TWinControl; Icon: integer; Title: pchar; Text: PWideChar; BackCL, TextCL: TColor); published { Published declarations } property xAuthor : ShortString read FxAuthor write SetxAuthor; property xVersion : ShortString read FxVersion write SetxVersion; end; procedure Register; implementation procedure Register; begin RegisterComponents('Kiyat', [TTooltipBaloon]); end; { TTooltipBaloon } constructor TTooltipBaloon.Create(AOwner: TComponent); begin inherited Create(AOwner); FxAuthor := 'Kiyat Yuni Saptoko'; FxVersion := 'April 2004'; end; destructor TTooltipBaloon.Destroy; begin inherited Destroy(); end; procedure TTooltipBaloon.SetxAuthor(const Value: ShortString); begin FxAuthor := Value; if FxAuthor <> 'Kiyat Yuni Saptoko' then FxAuthor := 'Kiyat Yuni Saptoko'; end; procedure TTooltipBaloon.SetxVersion(const Value: ShortString); begin FxVersion := Value; if FxVersion <>' April 2004' then FxVersion := 'April 2004'; end; procedure TTooltipBaloon.ShowBalloonTip(Control: TWinControl; Icon: integer; Title: pchar; Text: PWideChar; BackCL, TextCL: TColor); const TOOLTIPS_CLASS = 'tooltips_class32'; TTS_ALWAYSTIP = $01; TTS_NOPREFIX = $02; TTS_BALLOON = $40; TTF_SUBCLASS = $0010; TTF_TRANSPARENT = $0100; TTF_CENTERTIP = $0002; TTM_ADDTOOL = $0400 + 50; TTM_SETTITLE = (WM_USER + 32); ICC_WIN95_CLASSES = $000000FF; type TOOLINFO = packed record cbSize: Integer; uFlags: Integer; hwnd: THandle; uId: Integer; rect: TRect; hinst: THandle; lpszText: PWideChar; lParam: Integer; end; var hWndTip: THandle; ti: TOOLINFO; hWnd: THandle; begin hWnd := Control.Handle; hWndTip := CreateWindow(TOOLTIPS_CLASS, nil, WS_POPUP or TTS_NOPREFIX or TTS_BALLOON or TTS_ALWAYSTIP, 0, 0, 0, 0, hWnd, 0, HInstance, nil); if hWndTip <> 0 then begin SetWindowPos(hWndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE); ti.cbSize := SizeOf(ti); ti.uFlags := TTF_CENTERTIP or TTF_TRANSPARENT or TTF_SUBCLASS; ti.hwnd := hWnd; ti.lpszText := Text; Windows.GetClientRect(hWnd, ti.rect); SendMessage(hWndTip, TTM_SETTIPBKCOLOR, BackCL, 0); SendMessage(hWndTip, TTM_SETTIPTEXTCOLOR, TextCL, 0); SendMessage(hWndTip, TTM_ADDTOOL, 1, Integer(@ti)); SendMessage(hWndTip, TTM_SETTITLE, Icon mod 4, Integer(Title)); end; end; end. |
Random Articles
- Free Pascal dan VS Code
- Combobox didalam cell stringgrid dan radio butto didalam listbox
- Dynamic Menu based on MySQL Database Method II
- Dynamic Menu based on MySQL Database Method I
- Menyembunyikan Aplikasi Dari Taskbar dan System
- Release: FastPlaz Super Mom v0.12.22
- Comport
- Delphi For Android Progress & Component Poll
- Menjalankan Aplikasi trial untuk 1 kali jalan
- TheDevShop releases dbQwikSite Personal Edition
Last Articles
Recent Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 3 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 3 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 11 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 11 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 11 years ago