极简单,在线等待!(50分)

T

tt55

Unregistered / Unconfirmed
GUEST, unregistred user!
请问,如何选中LISTVIEW中的某一项?如何使richedit中的滚动条,
随接收到的内容的逐渐增加而向下自动滚动,总是显示最新增加的内容?
识别字符串最后一项,如果是TAB键就是‘/t’,那么如何识别发送字符串的最后一个是ESC键呢?
 
好多问题,不过确认一点,
memo新增一行放在下面,richedit新增一条后显示最新记录,即自动向下滚动。
 
ListView1.Items.Item[aindex].Selected:=true ;
listview1.Scroll(0,100000);
 
请 noall 同志到
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1267669
来一下
谢谢
 
ListView1.Items.Item[aindex].Selected:=true ;
listview1.Scroll(0,100000);
抄的
 
正宗的方法:procedure TListItem.MakeVisible(PartialOK: Boolean);
在Form中放个按钮即可,粘贴以下程序段就可查看效果。
uses ...,conctrls;
procedure TForm1.Button1Click(Sender: TObject);
const
Names: array[0..5, 0..1] of string = (
('Rubble', 'Barney'),
('Michael', 'Johnson'),
('Bunny', 'Bugs'),
('Silver', 'HiHo'),
('Simpson', 'Bart'),
('Squirrel', 'Rockey')
);
var
I: Integer;
NewColumn: TListColumn;
ListItem: TListItem;
ListView: TListView;
begin
ListView := TListView.Create(Self);
with ListView do
begin
Parent := Self;
Align := altop;
ViewStyle := vsReport;
NewColumn := Columns.Add;
NewColumn.Caption := 'Last';
NewColumn := Columns.Add;
NewColumn.Caption := 'First';
for I := Low(Names) to High(Names)*20 do
begin
ListItem := Items.Add;
ListItem.Caption := Names[I mod 5][0];
ListItem.SubItems.Add(Names[I mod 5][1]);
listitem.MakeVisible (true);
//正宗的方法。
application.ProcessMessages ;
sleep(100);
end;
end;
end;

Esc 即 chr(27) 或要用 #27 表示。
 
多人接受答案了。
 
顶部