Вниз
Скачать: CL | DM;

Как обнаружить прокрутку RichEdit?   Найти похожие ветки 

 
iosafat ©   (2004-01-31 12:27) [0]

Здравствуйте! Как обнаружить прокрутку RichEdit?


 
TUser ©   (2004-01-31 12:31) [1]

OnMouseWheel/ OnMouseWheelUp/ OnMouseWheelDown - но это среагирует только на прокрутку колесиком. Если кликать на скроллбар - ничего не будет.


 
TUser ©   (2004-01-31 12:58) [2]

А чтобы ваще хорошо было надо так
unit Unit1;

interface

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

type
TMyRichEdit = class(TRichEdit)
private
public
procedure WMVSCROLL(var Msg:TMessage); message WM_VSCROLL;
procedure WMMouseWheel(var Msg:TMessage); message WM_MOUSEWHEEL;
end;

TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
MyRichEdit1:TMyRichEdit;
a:integer;

implementation

{$R *.dfm}

procedure TMyRichEdit.WMVSCROLL(var Msg:TMessage);
begin
inc(a);
inherited;
end;

procedure TMyRichEdit.WMMouseWheel(var Msg:TMessage);
begin
inc(a);
inherited;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
a:=0;
MyRichEdit1:=TMyRichEdit.Create(application);
with MyRichEdit1 do begin
Parent:=Form1;
Left:=10; Width:=300;
Top:=10; height:=300;
scrollbars:=ssVertical;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
showMessage(inttostr(a));
end;

end.


 
iosafat ©   (2004-01-31 14:12) [3]

Это не есть удобно. Мне надо отслеживать прокрутку у уже существующего РичЭдита.

Как обойти этот код:

procedure TForm1.FormCreate(Sender: TObject);
begin
a:=0;
MyRichEdit1:=TMyRichEdit.Create(application);
with MyRichEdit1 do begin
Parent:=Form1;
Left:=10; Width:=300;
Top:=10; height:=300;
scrollbars:=ssVertical;
end;
end;



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

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
9-29181
Номолос
2003-07-26 09:24
2004.02.10
DelphiX в Delphi 7.


8-29481
Darlock
2003-10-06 12:12
2004.02.10
Графический формат EPS


14-29545
Alexander666
2004-01-21 11:46
2004.02.10
Американские деньжата


1-29469
XfroSt
2004-01-30 13:38
2004.02.10
Сохранение части реестра в файл


1-29320
SeriousSam
2004-01-29 22:54
2004.02.10
как сделать что бы курсор возвращался в edit1и много еще что...




   Наверх