挑战高手的问题!(290分)

  • 主题发起人 jericho3164
  • 开始时间
J

jericho3164

Unregistered / Unconfirmed
GUEST, unregistred user!
我使用了PageControl,我限制了页标签上最多显示5个字符,这个程序如果打开了
10多个窗口后,PageControl就开始多行显示页标签了,
我想让PageControl压缩显示页标签,直到每个页标签上只剩一个字符后,再开始多行显示.
 
假设 PageControl1.MultiLine = False

procedure TForm1.Button1Click(Sender: TObject);
var I, Count, CapLen: Integer;
begin
Count := 10 //10 is the amount of the TTabSheets
For I := 1 to Count Do
Begin
With PageControl1.Pages[I - 1] Do
Begin
CapLen := Length(Caption);
If CapLen > 5 Then //5 is customized
Caption := Copy(Caption, 1, 5) + '...';
End;
End;
If PageControl1.PageCount > 9 Then //9 is customized
PageControl1.MultiLine := True;
end;
 
对呀,稍微做一下处理,应该可以的
但是有必要么?
 
同意楼上
 
对啊,这事不用高手,二楼的就可以了,俺不要分。
 
多人接受答案了。
 
顶部