General information
Category:
ActiveX controls in VFP
>
>TEXT TO m.strShape TEXTMERGE PRETEXT 8
>shape append
> new adChar(10) as Region,
> new adInteger as RegionID,
> ((shape append
> new adChar(20) as Series,
> new adInteger as RegionID )
> as ls relate regionID to RegionID)
>ENDTEXT
>
>#include adoconstants.h
>cn = Createobject("adodb.connection")
>rs = Createobject("adodb.recordset")
>cn.ConnectionString = "Provider=MsDataShape;Data Provider=NONE"
>cn.Open()
>rs.Open(m.strShape,cn,adOpenStatic,adLockOptimistic)
>
>For regions=1 To 3
> rs.AddNew
> rs.Fields("region").Value = "Region"+PADL(m.regions,2)
> rs.Fields("regionID").Value = m.regions
> For lseries = 1 To 5
> rs2 = rs.Fields("ls").Value
> rs2.AddNew
> rs2.Fields("Series").Value = "R"+PADL(m.regions,2)+":Line series"+PADL(m.lseries,2)
> Endfor
>Endfor
>
>ShowMe(rs)
>
>Function ShowMe(toRecordSet)
>Public oForm
>oForm = Createobject('myForm', toRecordSet)
>oForm.Show
>Endfunc
>
>Define Class myform As Form
> Height = 450
> Width = 750
> Name = "Form1"
>
> Add Object hflex As OleControl With ;
> Top = 10, Left = 10, Height = 430, Width = 730, Name = "Hflex", ;
> OleClass = 'MSHierarchicalFlexGridLib.MSHFlexGrid'
>
> Procedure Init
> Lparameters toRecordSet
> With This.hflex
> .Datasource = toRecordSet
> .AllowUserResizing = 3
> .Cols(0) = 2
> .Cols(1) = 1
> .ColWidth(0,0) = 16*15
> .ColWidth(0,1) = 100*15
>
> .Col = 2
> .ColSel = 2
> FOR ix = .FixedRows TO .Rows-1
> .Row = m.ix
> .RowSel = m.ix
> DO case
> CASE ix%5=0
> lnColor = RGB(255,255,0)
> CASE ix%4=0
> lnColor = RGB(0,255,255)
> CASE ix%3=0
> lnColor = RGB(192,192,0)
> CASE ix%2=0
> lnColor = RGB(0,192,192)
> OTHERWISE
> lnColor = RGB(192,192,192)
> ENDCASE
> .CellBackColor = m.lnColor
> ENDFOR
> Endwith
> Endproc
>Enddefine
>
>PS: You can do that with TV too. Then set oNode.BackColor = rgb(whatever).
>Cetin
hi,
Old thread but
How do i return BAND(0) column(2) row(xi) for any row clikced ?
I want to return RegionID for the corrsponding ROw ?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only