Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Treeview or MShflexgrid
Message
De
18/12/2007 03:44:32
Suhas Hegde
Dental Surgeon
Sirsi, Inde
 
 
À
05/12/2006 18:05:20
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01174842
Message ID:
01276420
Vues:
22
>
>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 ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform