Guidance
指路人
g.yi.org
software / rapidq / examples / GUI / Grid / gridcolorcell.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     DECLARE SUB CDrawCell (Col%, Row%, State%, Rect AS QRECT, Sender AS QSTRINGGRID)
     DECLARE FUNCTION GetFocus LIB "user32" ALIAS "GetFocus"() AS LONG

     CREATE Form AS QFORM
      CAPTION = "Form1"
      Width = 385
      Height = 337
      Center
      CREATE StringGrid1 AS QSTRINGGRID
       Left = 19
       Top = 10
       Height = 128
       Width = 336
       ondrawcell=CDrawCell
      END CREATE
      CREATE StringGrid2 AS QSTRINGGRID
       Left = 22
       Top = 157
       Height = 136
       Width = 328
       TabOrder = 9
       ondrawcell=CDrawCell
      END CREATE
     END CREATE

     DIM CGrid (0 TO 100 , 0 TO 100) AS LONG
     StringGrid2.cell (2 , 2)="3"
     Form.SHOWMODAL
     SUB CDrawCell (Col%, Row%, State%, Rect AS QRECT, Sender AS QSTRINGGRID)
      IF sender.col=col% AND sender.row=row% THEN
       IF getfocus()=sender.handle THEN
        c=RGB(150,250,150)
       ELSE
        c=RGB(200,200,200)
       END IF
       Sender.fillrect(Rect.left, Rect.Top, Rect.right, Rect.bottom, c)
       Sender.TextOut (Rect.left+1, Rect.Top+1 ,Sender.Cell(Col%, Row%), 0, -1)
      END IF
     END SUB
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-4-20  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2009-07-25 17:30:04