Вниз
Скачать: 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.016 c
7-29644
KyRo
2003-11-24 23:19
2004.02.10
Поиск по реестру


3-29210
RDen
2004-01-20 11:09
2004.02.10
Два вопроса: как узнать существует ли индекс у таблицы ?


14-29527
Vlad Oshin
2004-01-21 14:25
2004.02.10
:)------------------------------------------


1-29307
Алексей
2004-01-30 05:52
2004.02.10
Запрос XPath в XMLdocument


1-29391
Alexis
2004-02-01 14:58
2004.02.10
убрать полосу, содержащую заголовок окна...




   Наверх