'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$INCLUDE "RAPIDQ.INC" 

DECLARE SUB DrawCell2 (Col%, Row%, State%, Rect AS QRect, Sender AS QStringGrid)

CREATE MainForm AS QForm 
    Width = 800'640
    Height = 600'480'600
    Center
    Font.Size =10

CREATE GridPos AS QSTRINGGRID ' отчеты -------------------------
Align=AlTop
Height=MainForm.ClientHeight/2+20
        ColCount = 10
        RowCount = 10
        FixedCols=1
        FixedRows=0
        AddOptions( goThumbTracking)
OnDrawCell = DrawCell2
    END CREATE
 END CREATE 'QForm
MAinForm.Showmodal 

'*****************************************
SUB DrawCell2 (Col%, Row%, State%, Rect AS QRect, Sender AS QStringGrid)
with sender

if (Row%=0 )  and (Col%+1)/2<>(Col%+1)\2  and col%>0 then
	.FillRect(Rect.Left- .ColWidths(Col%)-1, Rect.Top, Rect.Left+ .ColWidths(Col%), Rect.Top+.RowHeights(Row%), &HFFEFA1)
	.TextOut(Rect.Left- .ColWidths(Col%)-1, Rect.Top+2, "09871", 0, -1)
end if     

if (Row%=1)  and (Col%+1)/2<>(Col%+1)\2 and col%>0 then
	.FillRect(Rect.Left- .ColWidths(Col%)-1, Rect.Top, Rect.Left+ .ColWidths(Col%), Rect.Top+.RowHeights(Row%), &H00ff00)
	.TextOut(Rect.Left- .TextWidth("123456781")/2, Rect.Top+2, "123456781", 0, -1)
end if     

if (Row%=2)  and (Col%+1)/2<>(Col%+1)\2 and col%>0 then
	.FillRect(Rect.Left- .ColWidths(Col%)-1, Rect.Top, Rect.Left+ .ColWidths(Col%), Rect.Top+.RowHeights(Row%), &Hffff00)
	.TextOut(Rect.Left- .TextWidth("123")/2, Rect.Top+2, "123", 0, -1)
end if     

end with 
End Sub    