Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ActiveX
Message
From
15/01/2003 08:45:41
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00741685
Message ID:
00741852
Views:
14
>I have an ActiveX control that I'm populating from an array. The ole container ActiveX window cycles as each node is filled vice just displaying the treeview after it has updated. Has anyone had this problem. I would expect the control to display after the nodes are filled.
>
>The code is here and it is in the nodeclick event.
>
>* Add items to oleFirst treeview control
>THISFORM.OleFirst.Nodes.Clear
>FOR i = 1 TO alen(arAptFirst)
> firstnode = "FirstNode"+alltr(str(m.i))
> IF m.i = 1
> o = THISform.oleFirst
> oNode = o.nodes.add(, 4, firstnode, arAptFirst[m.i], "pinin", )
> ELSE
> oNode = o.nodes.add(, 4, firstnode, arAptFirst[m.i], "pinout", )
> endif
>ENDFOR
>
>
>Thanks for resolution if you have one.
>
>I've tried .enabled = .f..
>
>Wayne Finch

Wayne,
One way is to play with visibility :
* Add items to oleFirst treeview control
Thisform.LockScreen = .T.
With Thisform.OleFirst
  .Visible = .F.
  .Nodes.Clear
  .Nodes.Add(, 4, "FirstNode1", arAptFirst[1], "pinin")
  For i = 2 To Alen(arAptFirst)
    firstnode = "FirstNode"+Alltr(Str(m.i))
    .Nodes.Add(, 4, firstnode, arAptFirst[m.i], "pinout", )
  Endfor
  .Visible = .T.
Endwith
Thisform.LockScreen = .F.
OTOH it sounds to be unnecessary to clear nodes first since you're assigning the same node.keys each time. Changing only text and adding-removing nodes as necessary sounds to be a faster way and might totally eliminate the need to play with visibility :
* Add items to oleFirst treeview control
With Thisform.OleFirst
  For ix=1 To Alen(arAptFirst)
    firstnode = "FirstNode"+Alltr(Str(m.ix))
    If ix > .Nodes.Count
      .Nodes.Add(, 4, firstnode, arAptFirst[m.ix], ;
          Iif(ix=1,"pinin","pinout") )
    Else
      .Nodes(firstnode).Text = arAptFirst[m.ix]
    Endif
  Endfor
  If .Nodes.Count >= ix
    For ix = .Nodes.Count To ix Step -1
      .Nodes.Remove(ix)
    Endfor
  Endif
Endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform