Thank you all for your valuable ideas. I've done the code working, and as you pointed out, it's better to avoid Do While loops at all costs. Here is the code I've used in the NodeClick event.
Lparameters Node
Thisform.B1.Enabled = .F.
* --- Be sure we select a Child, not a Parent node ...
Actually, I used this code in the Click and DblClick events of a TreeView ACtiveX object:
*** ActiveX Control Event ***
* --- Be sure we enable the button only if we select a Child, not a Parent node
ThisForm.B1.Enabled = .F.
* --- Be sure we select a Child, not a Parent node
q = .T.
Do While...
I have a Do while loop in a form. This loop is running, waiting for a logical variable to exit (stop). When I try to close the form clicking on [X] (and firing this way the Destroy event), the form is not closing, because the loop is still running. How can I do this?
Thanks.
Neculai
Thanks, Olaf
For i = 1 To This.List1.Nodes.Count
This.List1.Nodes(i).BackColor = RGB(255,255,255)
This.List1.Nodes(i).ForeColor = RGB(0,0,128)
Next
oFont = This.List1.Font
With oFont
.Name = 'Arial'
.Size = '8'
Endwith
It works perfectly.
All the best,
Neculai
Thank you all, I finally made The TreeView work. My mistake was that I was trying to delete nodes in a For-Next loop, and the initial counter was not dynamically decreased automatically. So I used the For-Next in a Do while-Enddo loop with few more variables.
One more question. I try to change...
Thank you, Vilhelm.
Actually, my code is more lengthy and complex and I did some tricks like counting how many children I have before the actual deleting. Indeed, I thought first that the nCount is dynamical changed, but it's not. Still, I have the same problem, when I do these steps:
1. I...
Hi, experts
I want to use TreeView dynamically. I did these steps (code below is simplified):
1. Built one TreeView (code in Form's Init) with 2 parents
This.List1.Nodes.Add(, 1, 'TX', 'Taxonomy', 0)
This.List1.Nodes.Add(, 1, 'ID', 'Identifiers', 0)
This.List1.Nodes.Add('TX', 4...
Thanks, Mike and Olaf. I've followed your advises and here it's my code in the Init of the Grid.
*--- curColor
Create Cursor curColor(iColor I)
*--- Set the relationship
Select (This.RecordSource)
Go Top
Set Relation To Recno() Into curColor
*--- Populate curColor
Select (This.RecordSource)...
Hi, experts
I've tried to achieve the alternate coloring, and something is obviously wrong for me. Here is my code in the Init of the Grid.
*--- Create the index for sorting on columns
Select (This.RecordSource)
Index on accenumb tag accenumb of (This.RecordSource)
Index on genus tag genus...
Thank you, Mike and Dan. I've used a ListBox with few items, and I did the TreeView Like behaviour (expanding from a node), but I couldn't do the reverse (once expanded, I couldn't do the return to the initial state). The graphics is not exactly like in TreeView node expanding, but the function...
I would like to know if it is possible to use TreeView control inside a ListBox. I have populated a ListBox with few items, using AddItem(), and one of the Items I would like to have the same behaviour like a TreeView. I don't have experience with TreeView at all, but I want to know if this...
Thanks, Olaf and Mike. Following your advice, I've fixed my menu, and now it works great, I've used Mike's approach. I would have liked to use different fonts and sizes for the menu characters, but it seems it's not recommendable because these are Windows settings. Tried
DEFINE PAD PadOne OF...
When I try to replace the System Menu with a Custom Menu, I have difficulties:
- if I click anywhere outside the Custom Menu, the Menu just disappears and I am stuck in Visual FoxPro9, not being able to close it, so I need to call Task Manager to force closing.
- if I click on an Item, the Form...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.