Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.09.05;
Скачать: CL | DM;

Вниз

Listbox   Найти похожие ветки 

 
Гость...   (2004-08-21 15:19) [0]

function RevealHint (Control: TControl; X,Y:integer): THintWindow;
var
ShortHint: string;
AShortHint: array[0..255] of Char;
HintPos: TPoint;
HintBox: TRect;
begin
Result := THintWindow.Create(Control);
ShortHint := GetShortHint(Control.Hint);
HintPos.X:=x;
HintPos.Y:=y;
Inc(HintPos.Y, Control.Height + 6);    
HintBox := Bounds(0, 0, Screen.Width, 0);
DrawText(Result.Canvas.Handle,
StrPCopy(AShortHint, ShortHint), -1, HintBox,
DT_CALCRECT or DT_LEFT or DT_WORDBREAK or DT_NOPREFIX);
OffsetRect(HintBox, HintPos.X, HintPos.Y);
Inc(HintBox.Right, 6);
Inc(HintBox.Bottom, 2);
Result.ActivateHint(HintBox, ShortHint);
end;

procedure RemoveHint (var Hint: THintWindow);
begin
Hint.ReleaseHandle;
Hint.Free;
Hint := nil;
end;

procedure Tmain.list_temaMouseMove(Sender: TObject; Shift: TShiftState; X,
 Y: Integer);
var
p:tpoint;
begin
case list_type.ItemIndex of
0:begin
if (p.X=x) and (p.Y=y) then exit;
p.X:=x;
p.Y:=y;

il:=list_tema.ItemAtPos(p,true);
list_tema.ItemIndex:=il;
if h=nil then begin

 if length(list_tema.Items[il])>45 then begin
   Application.ProcessMessages;

     list_tema.hint:=list_tema.items[il];

     revealHint(list_tema,x,y);
     

 end else removehint(h);

end;

end;
end;
end;

где h:thintwindow;

Помогите решить проблему с миганием хинта!


 
QuasiLamo ©   (2004-08-21 15:32) [1]

в код не вчитывался, лень...
двойная буферизация иногда избавляет от мограния оконных компонентов


 
Гость...   (2004-08-21 15:33) [2]

буферизацию, что включать на форме?


 
QuasiLamo ©   (2004-08-21 15:41) [3]

свойство doubleduffered не знаю где, то, что мограет то и должно быть с doblebuffered=true


 
Гость...   (2004-08-21 20:13) [4]

Все! Проблему решил!!! Сам...
Если кому надо

procedure Tmain.list_temaMouseMove(Sender: TObject; Shift: TShiftState; X,
 Y: Integer);
var
p:tpoint;
begin
case list_type.ItemIndex of
0:begin
if (p.X=x) and (p.Y=y) then exit;
p.X:=x;
p.Y:=y;

il:=list_tema.ItemAtPos(p,true);

if il=list_tema.ItemIndex then exit;

list_tema.ItemIndex:=il;

if h<>nil then removehint(h);

 if length(list_tema.Items[il])>45 then begin
   Application.ProcessMessages;

     list_tema.Hint:=list_tema.Items[il];

     h:=revealhint(list_tema,main.Left+list_tema.Left,list_tema.Top+y);

     
 end else
     if h<>nil then removehint(h);

end;
end;
end;



Страницы: 1 вся ветка

Текущий архив: 2004.09.05;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.062 c
6-1088772058
Soft
2004-07-02 16:40
2004.09.05
Отсылка письма через нажатие кнопки в другом письме.


1-1092860381
nester
2004-08-19 00:19
2004.09.05
Что делать с локальными типизироваными константами в Делфи 7


14-1092631028
КаПиБаРа
2004-08-16 08:37
2004.09.05
Порекомендуйте программы


14-1092413274
Undert
2004-08-13 20:07
2004.09.05
Модераторы


14-1092652587
КаПиБаРа
2004-08-16 14:36
2004.09.05
Человеку который хотел добавить нолики впереди числа