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

Вниз

Рисовать курсором на форме?   Найти похожие ветки 

 
systematic ©   (2002-06-06 22:42) [0]

На форме Form1 нужно при удержании левой кнопки мыши рисовать, а при отпускании - перестать. КАК???


 
systematic ©   (2002-06-06 22:47) [1]

Да, надо красным цветом


 
lipskiy ©   (2002-06-06 23:01) [2]

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
TForm1 = class(TForm)
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
Drawing:boolean;

implementation

{$R *.DFM}

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Canvas.Pen.Color:= clred;
if Drawing then Canvas.LineTo(x,y);
//if Drawing then Canvas.Pixels[x,y]:= clred;
end;

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Drawing:= Button = mbLeft;
if Drawing then Canvas.MoveTo(x,y);
end;

procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Drawing:= false;
end;

end.


 
systematic ©   (2002-06-07 10:04) [3]

Спаисбо!



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

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

Наверх




Память: 0.47 MB
Время: 0.016 c
1-65087
BOOMER
2002-05-30 10:41
2002.06.20
Ошибки и стэк


3-64917
Dimaiv
2002-05-25 16:40
2002.06.20
Когда работаешь через TTable Delphi,


4-65293
Leon_O
2002-04-16 21:45
2002.06.20
SetupInstallFromInfSection


3-64998
Fissher
2002-05-29 12:14
2002.06.20
Как прописать путь к базе?


6-65194
Joker_555
2002-04-10 04:32
2002.06.20
Работа с ICQ