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

Вниз

Ширина текста в TWinControl   Найти похожие ветки 

 
Sirruf   (2004-05-20 14:38) [0]

Может быть, вопрос тривиальный, но в факах так ничего и не нашел. Как узнать сабж, чтобы в случае если текст не помещается в компонент TRxLookupEdit, выдавать хинт с полным текстом?


 
WebErr ©   (2004-05-20 14:43) [1]

GetCharABCWidth + F1


 
Игорь Шевченко ©   (2004-05-20 14:53) [2]


> Ширина текста в TWinControl

function GetTextWidthInPixels(AText: string; AControl: TControl): integer;
var
 propInfo: PPropInfo;
 thisFont: TFont;
begin
 Result := 0;

 propInfo := GetPropInfo(AControl.ClassInfo, "Font");

 if propInfo <> nil then begin
   thisFont := TFont(GetObjectProp(AControl, "Font"));

   if Assigned(thisFont) then
     with TControlCanvas.Create do
       try
         Control := AControl;
         Font.Assign(thisFont);
         Result  := TextWidth(AText);
       finally
         Free;
       end;
 end;
end;



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

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

Наверх




Память: 0.47 MB
Время: 0.029 c
3-1083599096
Крутыш
2004-05-03 19:44
2004.05.30
Тормаза при перемещениях


1-1084558596
DIS
2004-05-14 22:16
2004.05.30
MsAgent


1-1084459931
glGLU
2004-05-13 18:52
2004.05.30
StringGrid


3-1084256289
goozman
2004-05-11 10:18
2004.05.30
Function UPPER


14-1084433607
syte_ser78
2004-05-13 11:33
2004.05.30
Что с компом?