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

Вниз

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

 
greengeneral   (2007-11-21 21:40) [0]

В Edit есть MaxLength, а есть ли в StringGrid, если нет тогда кто нибудь знает как ограничить кол-во символов допустимые для ввода в ячейки StringGrid. Заранее спасибо.


 
engine ©   (2007-11-21 21:52) [1]

procedure TForm1.StringGrid1GetEditText(Sender: TObject; ACol,
 ARow: Integer; var Value: String);
begin
if Length(Value) > 10 then Delete(Value, 11, Length(Value) — 10);
end;


 
Reindeer Moss Eater ©   (2007-11-21 21:52) [2]

Write an OnGetEditMask event handler to provide the in-place editor with an edit mask that describes the valid input strings a user can type into a cell.


 
Reindeer Moss Eater ©   (2007-11-21 21:56) [3]

GetEditText вызывается перед началом редактирования. И не вызывается в процессе ввода.


 
Leonid Troyanovsky ©   (2007-11-22 10:00) [4]


> engine ©   (21.11.07 21:52) [1]



procedure TForm1.StringGrid1GetEditText(Sender: TObject; ACol,
 ARow: Integer; var Value: String);
var
 h: HWND;
begin
 h := GetTopWindow((Sender as TStringGrid).Handle);
 if h <> 0 then
   FindControl(h).Perform(EM_SETLIMITTEXT, 10, 0);
end;

--
Regards, LVT.



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

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

Наверх




Память: 0.47 MB
Время: 0.025 c
15-1195192823
MBo
2007-11-16 09:00
2007.12.16
Пятничные задачки. Вася Пупкин еще жив ;)


1-1190978060
wild_arg
2007-09-28 15:14
2007.12.16
группировка строк в TExcelApplication


15-1195215176
sds
2007-11-16 15:12
2007.12.16
Справочная служба аэропорта


15-1194730016
Leonid Troyanovsky
2007-11-11 00:26
2007.12.16
Самые распространенные дельфийские заблуждения


10-1141661852
Alex Kryuchkov
2006-03-06 19:17
2007.12.16
СОМ через SSL-соединение