Главная страница
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.009 c
6-65192
rediska
2002-04-12 18:00
2002.06.20
DNS Lookup. Или как узнать днс имя, имея ип.


1-65103
Demon Ltd
2002-06-06 23:03
2002.06.20
работа с Excel


3-64919
vfv
2002-05-26 11:34
2002.06.20
CachedUpdates


3-64904
Bardel
2002-05-25 12:46
2002.06.20
Открытие базы данных MSAcces в Delphi


3-64923
oss
2002-05-24 10:53
2002.06.20
Midas,ADO