Вниз
Скачать: 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 вся ветка

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



Память: 0.45 MB
Время: 0.008 c
14-65252
Феликс
2002-05-16 00:37
2002.06.20
Бойцовский клуб. Still pumped from the using mouse...


7-65264
Miron12
2002-03-22 16:11
2002.06.20
ServiceApplication


4-65301
panov
2002-04-18 13:19
2002.06.20
Семафоры и события


3-64946
ЮРИЙ_К
2002-05-27 15:55
2002.06.20
Строки в DBCtrlGrid разными цветами.


1-65068
Nebula
2002-06-10 12:43
2002.06.20
Reports




   Наверх