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

Каким образом в ListBox-e можно менять местами item-ы   Найти похожие ветки 

← →
KIG_S ©   (2002-06-10 13:10) [0]

Каким образом в ListBox-e можно менять местами item-ы
Например как в winamp-e.
Зарание Блогодарен!!!!


← →
Игорь Шевченко ©   (2002-06-10 13:14) [1]

unit main;

interface

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

type
TForm1 = class(TForm)
ListBox1: TListBox;
procedure ListBox1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
procedure ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
ListBox1.BeginDrag({not (Button = mbLeft)}false);
end;

procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
begin
if Source = ListBox1 then
with ListBox1,ListBox1.Items do
Move(ItemIndex, ItemAtPos(Point(X, Y), True));
end;

procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
Accept:=Source = ListBox1;
end;

end.



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

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



Память: 0.45 MB
Время: 0.007 c
14-65208
Miwa
2002-04-19 15:55
2002.06.20
Глюк в Delphi.MAstak.ru Forum Client?


14-65210
Sam08
2002-05-17 15:18
2002.06.20
Эй Ну кто из вас наладил продажу своей программы в сети


6-65196
Rammst
2002-04-13 08:56
2002.06.20
Закачка E-mail ов


1-65062
Катерина
2002-06-10 11:53
2002.06.20
Формулы в TStrings


14-65233
Agent Smith
2002-05-16 16:32
2002.06.20
StarWars 2




   Наверх