DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: a1871584487
今日帖子: 12
在线用户: 11
导航: 论坛 -> 移动应用开发 斑竹:flyers,iamdream  
作者:
男 muxiaolin1985 (没有蛀牙) ★☆☆☆☆ -
普通会员
2005/10/28 21:47:12
标题:
statusbar中加入进度条 浏览:4040
加入我的收藏
楼主: 谁有statusbar中加入进度条的例子能告诉我或有什么第3方的控件 我是菜鸟不要笑我 例子要完整一点的 谢谢了 啊
----------------------------------------------
-
作者:
男 yongren (啊强) ★☆☆☆☆ -
普通会员
2005/10/29 7:29:13
1楼: 你在创建进度条的时候指定父窗口为statusbar,不过好像在DElphi里还要调整位置,才会到指定的panel上。在vc里不用调整位置!
----------------------------------------------
-
作者:
男 zjkzs (zjkzs) ★☆☆☆☆ -
普通会员
2005/10/29 8:06:55
2楼: 修改DFM,在设计期就能看到效果,设置属性。
此帖子包含附件:
JPEG 图像
大小:9.2K
----------------------------------------------
-
作者:
男 cjianwen (空前) ★☆☆☆☆ -
盒子活跃会员
2005/10/29 9:07:12
3楼: 关注!
----------------------------------------------
作者:
男 gongags (gongags) ★☆☆☆☆ -
盒子活跃会员
2005/10/29 9:14:30
4楼: 记得要加个timer哦
----------------------------------------------
IT Work
作者:
男 wuzuren (wuzuren) ★☆☆☆☆ -
盒子活跃会员
2005/11/8 15:40:21
5楼:   private
  progressbar:tprogressbar; //进度条组件
  progressbarrect:trect; 
procedure TForm1.Button2Click(Sender: TObject);
var i,stepcount:integer;
begin
progressbar:=tprogressbar.Create(form1);
stepcount:=2000;
with progressbar do
  begin
  top:=progressbarrect.Top ;
  left:=progressbarrect.Left ;
  width:=progressbarrect.Right -progressbarrect.Left  ;
  height:=progressbarrect.Bottom-progressbarrect.Top ;
  try
  parent:=statusbar1;
  min:=0;
  max:=stepcount;
  step:=2;
  for i:=1 to max do
    begin
    position:=position+i;
    end;
    showmessage('操作完成');
  finally
  end;
  end;
end;
----------------------------------------------
-
作者:
男 wuzuren (wuzuren) ★☆☆☆☆ -
盒子活跃会员
2005/11/8 15:42:08
6楼: 再加上
procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
  Panel: TStatusPanel; const Rect: TRect);
begin
progressbarrect:=rect; // 进度条组件的尺寸设定为状态条中的第二个显示面板的尺寸
//因为该面板的STYLE属性已被设置为psownerdraw
end;
----------------------------------------------
-
作者:
男 sephil (NAILY Soft) ★☆☆☆☆ -
盒子中级会员
2005/11/9 15:10:03
7楼: 不用那么复杂,只要处理一下StatusBar1DrawPanel即可
条件是 StatusBar1.Panels[1].Style := psOwnerDraw;

procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
  Panel: TStatusPanel; const Rect: TRect);
begin
  if Panel.Index = 1 then
  begin
    ProgressBar1.Parent := StatusBar1;
    ProgressBar1.BoundsRect := Rect;
  end.
end;

不过2楼方法更牛!!
----------------------------------------------
Copyright 2008 ? NAILY Soft

Click here to redirect to my home
Click here to redirect to my blog
作者:
男 blacksheep2005 (小强) ★☆☆☆☆ -
盒子活跃会员
2005/11/11 9:26:08
8楼: zjkzs (zjkzs) ▲△△△△ 男的普通会员 -  
 2005-10-29 8:06:55 
2楼: 修改DFM,在设计期就能看到效果,设置属性。 


如何修改DFM阿?DFM为何物?
----------------------------------------------
QQ:13217892
EMail:blacksheep2000@sina.com
作者:
男 zjkzs (zjkzs) ★☆☆☆☆ -
普通会员
2005/11/11 9:53:06
9楼: dfm文件就在你的工程里啊,比如:Unit1.dfm,主要是保存窗体的初始化数据,
你打开看看就全明白了,格式大概是下面的样子,
object Form1: TForm1
  Left = 193
  Top = 143
  Width = 544
  Height = 375
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object StatusBar1: TStatusBar
    Left = 0
    Top = 323
    Width = 536
    Height = 25
    Panels = <
      item
        Width = 100
      end
      item
        Width = 100
      end
      item
        Width = 150
      end
      item
        Width = 105
      end
      item
        Width = 50
      end>
    SimplePanel = False
    object Edit1: TEdit
      Left = 1
      Top = 3
      Width = 98
      Height = 21
      TabOrder = 0
      Text = ' Edit1'
    end
    object CheckBox1: TCheckBox
      Left = 107
      Top = 5
      Width = 90
      Height = 19
      Caption = '全部数据'
      Checked = True
      State = cbChecked
      TabOrder = 1
    end
    object ProgressBar1: TProgressBar
      Left = 205
      Top = 5
      Width = 142
      Height = 18
      Min = 0
      Max = 100
      Position = 75
      TabOrder = 3
    end
    object ScrollBar1: TScrollBar
      Left = 355
      Top = 6
      Width = 95
      Height = 16
      PageSize = 0
      Position = 30
      TabOrder = 2
    end
  end
  object StringGrid1: TStringGrid
    Left = 0
    Top = 0
    Width = 536
    Height = 323
    Align = alClient
    Color = clInfoBk
    ColCount = 8
    DefaultRowHeight = 19
    RowCount = 20
    Font.Charset = GB2312_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = '宋体'
    Font.Style = []
    ParentFont = False
    TabOrder = 1
  end
end
----------------------------------------------
-
作者:
男 blacksheep2005 (小强) ★☆☆☆☆ -
盒子活跃会员
2005/11/11 10:32:04
10楼: 我将    object ProgressBar1: TProgressBar
      Left = 205
      Top = 5
      Width = 142
      Height = 18
的这几项改成statusbar的PANEL1的参数设置,但有一项改不了。当LEFT对齐时,TOP总对齐不了啊
例如: LEFT改成100,TOP怎么也该不成323。
是怎么回事啊?
----------------------------------------------
QQ:13217892
EMail:blacksheep2000@sina.com
作者:
男 phynex_chen (phynex_chen) ★☆☆☆☆ -
盒子活跃会员
2006/6/23 20:30:14
11楼: 使用 Raize。
----------------------------------------------
-
作者:
男 lzksword (lzksword) ★☆☆☆☆ -
普通会员
2009/12/29 21:54:48
12楼: 我试用一下,看看有用不
----------------------------------------------
-
作者:
男 kinneng (kinneng) ★☆☆☆☆ -
盒子活跃会员
2009/12/30 0:31:22
13楼: 古董贴,还顶上来
----------------------------------------------
声明:本人不在论坛询问任何编程问题,请不要将我的帖子当成问题来回答。炒股一天,编程三年,不浪费时间了。 经常在外面,没空,不要找我..
作者:
男 mlyang_hit (mlyang_hit) ★☆☆☆☆ -
普通会员
2009/12/31 9:17:54
14楼: 古董贴,再翻新一下:
楼上所述均有道理,但都不符合“编程享受”之原则!建议用附件轻松搞定,尽情享受编程之乐趣吧!
声明:控件已在D2009及之前版本测试OK,在D2010上未作测试,留请“好事者”进行,并回馈信息为盼!
Paaendix:
IMPROVEMENTS (in comparison with TStatusBar)
TStatusBarPro has the following new properties in Delphi 4 or higher:

Images: TCustomImageList
Holds a list of bitmaps that can be displayed on the panels of the control. 
AutoHintPanelIndex: Integer
When AutoHint property set to true, determines on which panel hint text appears. 
TStatusBarPro has the following new properties in Delphi 3:

Images: TImageList
Holds a list of bitmaps that can be displayed on the panels of the control. 
Color: TColor
Specifies the background color of the control. 
UseSystemFont: Boolean
Specifies whether the status bar uses the system font. 
Type of the following event has changed:

OnDrawPanel: TDrawPanelProEvent
TDrawPanelProEvent = procedure(StatusBar: TStatusBarPro; Panel: TStatusPanelPro; const Rect: TRect) of object
Occurs when an owner draw panel needs to be redrawn. 
Type of the following property has changed:

Panels: TStatusPanelsPro
Contains lists of the status bar's panels (TStatusPanelPro). 
Each panel (TStatusPanelPro) has the following new properties:

AutoSize: Boolean
Determines whether the width of the panel should be automatically adjusted according to the StatusBarPro's size. Setting this property to True, with set the AutoWidth property to False. 
AutoWidth: Boolean
Determines whether the width of the panel should be automatically adjusted according to the content of the panel. Setting this property to True, with set the AutoSize property to False. 
Color: TColor
Specifies the background color of the panel. 
ParentColor: Boolean
Determines whether the panel uses the color of the TStatusBarPro that owns it. 
ImageIndex: TImageIndex
Determines index of the image (from the TStatusBarPro.Images) that appears on the panel. 
Indent: Integer
Specifies how far the panel's contents (image and text) are indented. 
Font: TFont
Specifies the font to use when writing text on the panel. 
MaxWidth: Integer
Specifies the maximum size of the panel in pixels. When the AutoSize property is True, changing this propery has no effect. 
MinWidth: Integer
Specifies the minimum size of the panel in pixels. When the AutoSize property is True, changing this propery has no effect. 
ParentFont: Boolean
Determines where the panel looks for its font information. 
Hint: String
Contains the text string that can appear when the user moves the mouse over the panel. If this property set to blank, hint property of TStatusBarPro will be used. 
PopupMenu: TPopupMenu
Identifies the pop-up menu associated with the panel. If this property set to nil, PopupMenu property of TStatusBarPro will be used. 
Control: TControl
Determines the control that is assigned to the panel. When a control assigns to this property, the parent of the control changes to the status bar and the control covers the panel's bounding rectangle. 
Each panel (TStatusPanelPro) has the following new events:

OnClick: TNotifyEvent
Occurs when the use click the panel. If this event is unassigned, the OnClick event of TStatusBarPro will be fired. 
OnDblClick: TNotifyEvent
Occurs when the user double-clicks the primary mouse button when the mouse pointer is over the panel. If this event is unassigned, the OnDblClick event of TStatusBarPro will be fired. 
OnContectPopup: TContextPopupEvent
Occurs when the user right-clicks the panel.
此帖子包含附件:mlyang_hit_2009123191754.zip 大小:16.3K
----------------------------------------------
-always make things simple! 

http://www.51xuewen.com/group/1489/topic_17295.htm
作者:
男 gaoyanan (高亚男) ★☆☆☆☆ -
普通会员
2010/1/6 10:40:18
15楼: 用RC组件最简单,自己写代码页可以,就是一个自绘图而已。
----------------------------------------------
本人,男,35岁,无房无车,无权无势,招一名贤良淑德、善解人意的女孩,拜金、月光的请勿打扰。
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行101.5625毫秒 RSS