海信家电”换帅 “ 高玉玲接替代慧忠出任新任董事长
2024-11-22
1.//首先在FormCreate事件中编写代码 procedure TForm1.FormCreate(Sender: TObject); var ProgressBarStyle: integer; begin //将状态栏的第二块面板设为的自绘(即psOwnerDraw) StatusBar1.Panels[1].Style := psOwnerDraw; //将进程条放入状态栏 ProgressBar1.Parent := StatusBar1; //去除状态栏的边框,这样就与状态栏溶为一体了 ProgressBarStyle := GetWindowLong(ProgressBar1.Handle,GWL_EXSTYLE); ProgressBarStyle := ProgressBarStyle - WS_EX_STATICEDGE; SetWindowLong(ProgressBar1.Handle, GWL_EXSTYLE, ProgressBarStyle); end; 2.//编写状态栏的自绘代码 procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;Panel: TStatusPanel;const Rect: TRect); begin //注意这里的Panels[1]指的就是第2块面板,因为默认是从0开始的 if Panel = StatusBar.Panels[1] then with ProgressBar1 do begin Top := Rect.Top; Left := Rect.Left; Width := Rect.Right - Rect.Left - 15; Height := Rect.Bottom - Rect.Top; end; end; |
procedure TForm1.Button1Click(Sender: TObject); var i : integer; begin ProgressBar1.Position := 0; ProgressBar1.Max := 100; for i := 0 to 100 do begin ProgressBar1.Position := i; Sleep(25); end; end; |
评论 {{userinfo.comments}}
{{child.content}}
{{question.question}}
提交