当前位置:首页
开发技术指南» 文章正文
    引言:

 ·如何用timage的canvas作一个点    »显示摘要«
    摘要: 如题。 我知道,可以用moveto(x,y);lineto(x,y);来作,但没有别的更直接的方法了吗? ......
 ·excel    »显示摘要«
    摘要: 有没有办法让excel文档不能复制,或是复制后不能有效使用. ......


新手提问.

请问各位前辈,怎样才能在StatusBar中显示程序执行进度?就像IE中那样         谢谢

NO.1   作者: sdrcxzy

还要有一个progressbar  
  用api函数setparent把它放进StatusBar里面。  
   
  需要一个Form\Timer\CommandButton\ProgressBar\StatusBar  
   
  Option   Explicit  
   
   
  Private   Declare   Function   SetParent   Lib   "user32"   (ByVal   hWndChild   As   Long,   ByVal   hWndNewParent   As   Long)   As   Long  
  Private   Declare   Function   SendMessage   Lib   "user32"   Alias   "SendMessageA"   (ByVal   hwnd   As   Long,   ByVal   wMsg   As   Long,   ByVal   wParam   As   Long,   lParam   As   Any)   As   Long  
  Private   Const   WM_USER   =   &H400  
  Private   Const   SB_GETRECT   =   (WM_USER   +   10)  
  Private   Type   RECT  
          Left   As   Long  
            As   Long  
          Right   As   Long  
          Bottom   As   Long  
  End   Type  
   
  Private   Sub   Command1_Click()  
   
          ShowProgressInStatusBar   True  
          Timer1.Enabled   =   True  
   
   
  End   Sub  
  Private   Sub   ShowProgressInStatusBar(ByVal   bShowProgressBar   As   Boolean)  
   
          Dim   tRC   As   RECT  
   
          If   bShowProgressBar   Then  
   
                  SendMessage   StatusBar1.hwnd,   SB_GETRECT,   1,   tRC  
                  With   tRC  
                          .   =   (.   *   Screen.TwipsPerPixelY)   -   5  
                          .Left   =   (.Left   *   Screen.TwipsPerPixelX)  
                          .Bottom   =   (.Bottom   *   Screen.TwipsPerPixelY)   -   .   -   10  
                          .Right   =   (.Right   *   Screen.TwipsPerPixelX)   -   .Left  
                  End   With  
   
                  With   ProgressBar1  
                          SetParent   .hwnd,   StatusBar1.hwnd  
                          .Move   tRC.Left,   tRC.,   tRC.Right,   tRC.Bottom  
                          .Visible   =   True  
                          .Value   =   1  
                  End   With  
   
          Else  
                  SetParent   ProgressBar1.hwnd,   Me.hwnd  
                  ProgressBar1.Visible   =   False  
          End   If  
   
  End   Sub  
   
  Private   Sub   Form_Load()  
   
          With   Timer1  
                  .Enabled   =   False  
                  .Interval   =   10  
          End   With  
   
  End   Sub  
   
  Private   Sub   Timer1_Timer()  
   
          If   ProgressBar1.Value   =   100   Then  
                  Timer1.Enabled   =   False  
                  ShowProgressInStatusBar   False  
          Else  
                  ProgressBar1.Value   =   ProgressBar1.Value   +   1  
          End   If  
  End   Sub  
   
 


 ·请给推荐一个写asp的编辑软件    »显示摘要«
    摘要: 刚学asp.net,请大家给推荐一个方便易用的写asp的编辑软件,谢谢! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE