热情软件屋

 

进程条控件(ProgressBar)怎么使用


编号:QA000249
建立日期: 1998年12月23日 最后修改日期:1998年12月23日
所属类别:

甘炎新:
    进程条控件(ProgressBar)怎么使用?

回答:

    ProgressBar的使用比较简单。关键属性有三个:Max、Min、Value。ProgressBar根据Value和Max、Min之间的关系来决定进程条的位置。Max、Min的默认值为100和0。一般,你可以根据你的操作计算一个百分比,如何将Value设置为这个百分比。下面的这个程序动态的建立一个窗体和ProgressBar,每秒钟ProgressBar增加10%。
    PUBLIC oForm
    oForm = CREATEOBJECT("Form") && Create a form
    
    * The following line adds the ProgessBar control to the form.
    
    oForm.ADDOBJECT("OleProgress", "OLEControl", "COMCTL.ProgCtrl.1")
    
    * The following lines specify the location
    * and size of the ProgressBar control.
    
    oForm.OleProgress.Top = 5
    oForm.OleProgress.Left = 5
    oForm.OleProgress.Height = 25
    oForm.OleProgress.Width = 289
    
    oForm.OleProgress.Visible = .T. && Display the ProgessBar
    oForm.Visible = .T. && Display the Form
    
    FOR i = 1 to 10
     oForm.OleProgress.Value = i * 10 && Update the ProgressBar
     = INKEY(1) && Wait one second
    ENDFOR

此问题由李海回答。

 
把这个问题推荐给朋友
   
   
您的意见类别
您的名字
您的电子邮件
您的建议(请尽可能详细)
 
 

版权所有 1997-2008 热情软件屋
如果您有任何建议和意见, 请给我发个电子邮件 askpro@china-askpro.com
Web Designed by ZebraStudio