其他语言

本类阅读TOP10

·基于Solaris 开发环境的整体构思
·使用AutoMake轻松生成Makefile
·BCB数据库图像保存技术
·GNU中的Makefile
·射频芯片nRF401天线设计的分析
·iframe 的自适应高度
·BCB之Socket通信
·软件企业如何实施CMM
·入门系列--OpenGL最简单的入门
·WIN95中日志钩子(JournalRecord Hook)的使用

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
Showing Windows Progress Bar

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

If you're clients are all on Windows, you can display the progress bar when performing a long calculation. There are two types of progress bars -- one large graphical (like when you're copying a database) and one through the status bar at the bottom of the screen (like when you open a very large document over a dial-up connection).

For an example of the large graphical progress bar, build an agent with this code:

Const NPB_TWOLINE% = 1
Declare Function NEMProgressBegin Lib "nnotesws.dll" ( Byval wFlags As Integer ) As Long
Declare Sub NEMProgressEnd Lib "nnotesws.dll" ( Byval hwnd As Long )
Declare Sub NEMProgressSetBarPos Lib "nnotesws.dll" ( Byval hwnd As Long, Byval dwPos As Long)
Declare Sub NEMProgressSetBarRange Lib "nnotesws.dll" ( Byval hwnd As Long, Byval dwMax As Long )
Declare Sub NEMProgressSetText Lib "nnotesws.dll" ( Byval hwnd As Long, Byval pcszLine1 As String, Byval pcszLine2 As String )

Sub Initialize
   Dim hwnd As Long
   Dim i As Long
   Dim j As Long
   hwnd = NEMProgressBegin( NPB_TWOLINE )
   ' Set the bar range - the default is 100
   NEMProgressSetBarRange hwnd, 200
   ' Display text on the dialog.
   NemProgressSetText hwnd, "Calculating ...", "Start"
   For i = 0 To 200
      For j = 0 To 9000
         ' artificial delay for the example !!
      Next j
      ' Update the bar position
      NEMProgressSetBarPos hwnd, i
      ' Update the text at twenty five percent
      If i = 50 Then
         NEMProgressSetText hwnd, "Calculating ....", "25%"
      End If
      ' Update the text at fifty percent
      If i = 100 Then
         NEMProgressSetText hwnd, "Calculating .....", "50 %"
      End If
      ' Update the text at seventy five percent
      If i = 150 Then
         NEMProgressSetText hwnd, "Calculating ......", "75 %"
      End If
   Next
   ' Destroy the dialog when we're done
   NEMProgressEnd hwnd
End Sub

Run the agent and you will see the status bar.




相关文章

相关软件