صفحه 1 از 1

Boollon Tooltip in Delphi

ارسال شده: جمعه ۱ اردیبهشت ۱۳۸۵, ۱:۱۲ ب.ظ
توسط sina.genius
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
tagEDITBALLOONTIP = record
cbStruct: Longword;
pszTitle: PWChar;
pszText: PWChar;
ttiIcon: Integer;
end;
type
PEDITBALLOONTIP = ^tagEDITBALLOONTIP;

const
ECM_FIRST = $00001500;
EM_SHOWBALLOONTIP = ECM_FIRST + 3;


var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
ebt: tagEDITBALLOONTIP;
title, Text: Widestring;
icon: Integer;
begin
title := 'tooltip!!';
Text := 'in editbox :)';
icon := 1; //0,1,2,3
with ebt do
begin
cbStruct := SizeOf(ebt);
pszTitle := PWideChar(title);
pszText := PWideChar(Text);
ttiIcon := icon;
end;
SendMessage(Edit1.Handle, EM_SHOWBALLOONTIP, 0, Longint(@ebt));
end;

end.



فايل DFM هم اينه ...............

object Form1: TForm1
Left = 192
Top = 114
Width = 403
Height = 267
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 64
Top = 144
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 0
OnClick = Button1Click
end
object Edit1: TEdit
Left = 176
Top = 24
Width = 121
Height = 21
TabOrder = 1
Text = 'Edit1'
end
end

ارسال شده: جمعه ۱ اردیبهشت ۱۳۸۵, ۱:۱۵ ب.ظ
توسط Mahdi1944
sina.genius,
ورود شما رو به اين مرکز خوش‌امد مي‌گم :D
و تشکر به خاطر مطلب خوب شما
اميدوارم در آينده نيز از حضور شما در سايت استفاده کنيم :o