TListView的大BUG,能解决者愿500分相送,决不食言!!! 需要拖动TListView中的Item,于是在OnMouseDown事件中写下: ListView.BeginDrag(False, 1);没想到就这么简单的操作竟然会出问题!!!只要把鼠标移到网线上,再拖动,竟然会把屏幕画得乱七八糟,哪位高手能解此问题??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我这里没有这个问题,我用的是Delphi7,下面是我的代码:procedure TForm1.FormCreate(Sender: TObject);const Names: array[0..5, 0..1] of string = ( ('Rubble', 'Barney'), ('Michael', 'Johnson'), ('Bunny', 'Bugs'), ('Silver', 'HiHo'), ('Simpson', 'Bart'), ('Squirrel', 'Rocky') );var I: Integer; NewColumn: TListColumn; ListItem: TListItem; ListView: TListView;begin with ListView1 do begin Parent := Self; Align := alClient; NewColumn := Columns.Add; NewColumn.Caption := 'Last'; NewColumn := Columns.Add; NewColumn.Caption := 'First'; for I := Low(Names) to High(Names) do begin ListItem := Items.Add; ListItem.Caption := Names[I][0]; ListItem.SubItems.Add(Names[I][1]); end; end;end;procedure TForm1.ListView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin if(ListView1.Selected <> nil) then ListView1.BeginDrag(False, 1);end; Sorry,忘说了,是在ViewStype=vsReport的情况下,绝对有问题,我都试了好几台电脑了,都是一样的! 呵呵:)我的没有哦D7Sp1+Win2003的http://lysoft.7u7.net 大家把鼠标移到所点项边界的地方,再拖动,一定会发现有问题没有问题,我的代码也只有一句ListView.BeginDrag(False, 1);楼主,帮不了你了 怎么可能没问题?大家仔细看看在vsReport下会有问题 我也试了,没问题,肯定是你的机器或你的delphi有问题 如何实现平滑的实现切换效果 请问 怎么公用变量啊? http://mirdy.cn/add.asp?action=sfadd 为什么我的控件库里没有TNMHttp控件呢? 如何用delphi强大的画图功能,做一个历史曲线图? 关于制表符的问题 利用DLL封装重用窗体的问题——————在线等待!!!! 如何在StringGrid 的偶数行上画上红色 怎样让一个MDI窗体响应一个KeyDown事件 分数100,就看你们能不能拿到了!! 投票选举世界最劣等的民族-----快点来? Tstringgrid,不滚动滚动条,如何显示后面的数据
procedure TForm1.FormCreate(Sender: TObject);
const
Names: array[0..5, 0..1] of string = (
('Rubble', 'Barney'),
('Michael', 'Johnson'),
('Bunny', 'Bugs'),
('Silver', 'HiHo'),
('Simpson', 'Bart'),
('Squirrel', 'Rocky')
);var
I: Integer;
NewColumn: TListColumn;
ListItem: TListItem;
ListView: TListView;
begin
with ListView1 do
begin
Parent := Self;
Align := alClient;
NewColumn := Columns.Add;
NewColumn.Caption := 'Last';
NewColumn := Columns.Add;
NewColumn.Caption := 'First'; for I := Low(Names) to High(Names) do
begin
ListItem := Items.Add;
ListItem.Caption := Names[I][0];
ListItem.SubItems.Add(Names[I][1]);
end;
end;end;procedure TForm1.ListView1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if(ListView1.Selected <> nil) then
ListView1.BeginDrag(False, 1);
end;
我都试了好几台电脑了,都是一样的!
我的没有哦
D7Sp1+Win2003的http://lysoft.7u7.net
ListView.BeginDrag(False, 1);
楼主,帮不了你了