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

 

    摘要: 我每次只能进98系统,怎么样才能二个系统可以选择进入呢,不要重装系统的情况下 ......
    摘要: 看看水园里面有几个是名字带狼的,是狼就给分。 ......


怎样使Listview的每行背景色颜色不同。

我想让listview的行能够被2整除时这行的背景色颜色是红色,否则的话背景色就是绿色。

NO.1   作者: truemichael

Public   Function   LvwAltLinesBackground(ListView   As   ListView,   PictureBox   As   PictureBox,   Optional   ByVal   BackColorFirst   As   Boolean,   Optional   ByVal   AltLineBackColor   As   OLE_COLOR   =   -1)   As   StdPicture  
          Dim   nHeight   As   Single  
          Dim   nScaleWidth   As   Single  
          Dim   nAltLineBackColor   As   OLE_COLOR  
           
          With   ListView  
                  If   .View   =   lvwReport   Then  
                          If   .ListItems.count   Then  
                                  .PictureAlignment   =   lvwTile  
                                  nHeight   =   .ListItems(1).Height  
                                  With   PictureBox  
                                          .Visible   =   False  
                                          .Cls  
                                          If   AltLineBackColor   =   -1   Then  
                                                  nAltLineBackColor   =   .BackColor  
                                          Else  
                                                  nAltLineBackColor   =   AltLineBackColor  
                                          End   If  
                                          .BackColor   =   ListView.BackColor  
                                          .BorderStyle   =   0  
                                          .Height   =   nHeight   *   2  
                                          .Width   =   10   *   Screen.TwipsPerPixelX  
                                          nScaleWidth   =   .ScaleWidth  
                                          .AutoRedraw   =   True  
                                          If   BackColorFirst   Then  
                                                  PictureBox.Line   (0,   nHeight)-Step(nScaleWidth,   nHeight),   nAltLineBackColor,   BF  
                                          Else  
                                                  PictureBox.Line   (0,   0)-Step(nScaleWidth,   nHeight   -   Screen.TwipsPerPixelY),   nAltLineBackColor,   BF  
                                          End   If  
                                          Set   ListView.Picture   =   Nothing  
                                          Set   ListView.Picture   =   .Image  
                                          Set   LvwAltLinesBackground   =   .Image  
                                          .AutoRedraw   =   False  
                                          If   AltLineBackColor   =   -1   Then  
                                                  .BackColor   =   nAltLineBackColor  
                                          End   If  
                                  End   With  
                                  .Refresh  
                                  Exit   Function  
                          End   If  
                  End   If  
                  Set   .Picture   =   Nothing  
          End   With  
  End   Function


    摘要: 我想用alpha blending實現全視野的fade到黑屏,準備用一塊黑色矩形放在接近視點的地方,但是這塊黑矩形的方位與大小如何確定呢,要正好遮住整個視野. 我另外想問有沒有辦法直接寫後台已渲染好的buffer的alpha值? 以前directdraw中就是這樣做的. ......
» 本期热门文章:

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