Posted By

airwei on 06/09/12


Tagged


Versions (?)

Startus Bar如何能動態新增兩個panels


 / Published in: Delphi
 

第一個panel指定放文字,第二個panel指定放非文字(如進度progressBar)

  1. self.StatusBar1.Panels.Clear;
  2.  
  3. self.StatusBar1.Panels.AddItem(nil,0);
  4. self.StatusBar1.Panels[0].Width := trunc(SimpleRoundTo(self.ClientWidth/5)); // 寬度=1/5
  5. self.StatusBar1.Panels[0].Style := psText;
  6.  
  7. self.StatusBar1.Panels.AddItem(nil,1); //給progressBar 用
  8. self.StatusBar1.Panels[1].Style := psOwnerDraw;

Report this snippet  

You need to login to post a comment.