Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drag and drop in Treeview
Message
 
To
02/06/2005 13:24:37
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01019044
Message ID:
01019493
Views:
28
>>
>>thisform.oTree.SelectedItem = thisform.oTree.Nodes("_RT"+tran(x3))
>>
>
>
>I just sent you an email with screenshots (can't do it here AFAIK)

Here an example I do. Not a Perfect one but you'll get the point.
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


    **************************************************
*-- Form:         form1 (c:\traff\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   06/02/05 09:07:02 PM
*
DEFINE CLASS form1 AS form


    Top = 0
    Left = 0
    Height = 701
    Width = 375
    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"
    oldforecolor = .F.
    oldbackcolor = .F.


    ADD OBJECT command1 AS commandbutton WITH ;
        Top = 90, ;
        Left = 273, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Command1", ;
        Name = "Command1"


    ADD OBJECT olecontrol1 AS olecontrol WITH ;
        OleClass  = "MSComctlLib.TreeCtrl.2" ,;
        Top = 16, ;
        Left = 10, ;
        Height = 576, ;
        Width = 207, ;
        Name = "Olecontrol1"



    PROCEDURE Init
        oNode = thisform.olecontrol1.Nodes.add(,1,"root_","Root")
        thisform.oldbackcolor = oNode.BackColor
        thisform.oldforecolor = oNode.ForeColor
        FOR nTest = 1 TO 50
            thisform.olecontrol1.Nodes.Add("root_", 4, TRANSFORM(nTest)+"_" , "Node "+TRANSFORM(nTest))
        NEXT
        thisform.olecontrol1.Nodes("root_").Expanded = .t.
        thisform.olecontrol1.SelectedItem = oNode 
        thisform.olecontrol1.SetFocus()
    ENDPROC


    PROCEDURE olecontrol1.GotFocus
        this.HideSelection = .f.
        IF NOT ISNULL(this.SelectedItem)
           this.SelectedItem.BackColor = thisform.oldbackcolor
           this.SelectedItem.ForeColor = thisform.oldforecolor
        ENDIF
    ENDPROC


    PROCEDURE olecontrol1.LostFocus
        this.HideSelection = .t.
        IF NOT ISNULL(this.SelectedItem) 
           thisform.oldbackcolor       = this.SelectedItem.BackColor  
           thisform.oldforecolor       = this.SelectedItem.ForeColor  
           this.SelectedItem.BackColor = RGB(255,0,0)
           this.SelectedItem.ForeColor = RGB(255,255,255)
        ENDIF
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform