|
-
Oct 26th, 2007, 12:33 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Determine check only one node at parent
Hi all,
I created a treeview that's only allowed user check on only one node at all parent. Below is my code.
VB Code:
Dim CheckOnlyOne As Node
'checked
k = 0
Set CheckOnlyOne = Node.FirstSibling
j = 0
If CheckOnlyOne.Checked = True Then
Do Until CheckOnlyOne Is Nothing
If CheckOnlyOne.Parent Is Nothing Then
If CheckOnlyOne.Checked = True Then
j = j + 1
End If
End If
If j > 1 Then
MsgBox "Can select one department only", vbCritical, "Error to select department"
Node.Checked = False
Exit Sub
End If
Set CheckOnlyOne = CheckOnlyOne.Next
Loop
End If
The problem is when running debug with breakpoint the node is successfully to unchecked.However, when debugging end the node was checked back.
How to solve my problem ?
Thanks in Advance.
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Oct 26th, 2007, 02:00 AM
#2
Frenzied Member
Re: Determine check only one node at parent
Is this right?
Node.Checked = False
Shouldnt this be
CheckOnlyOne.Checked = False
-
Oct 26th, 2007, 02:24 AM
#3
Thread Starter
Hyperactive Member
Re: Determine check only one node at parent
I changed already, but still cannot ... it will unchecked the previous node instead of current node
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Oct 26th, 2007, 02:53 AM
#4
Frenzied Member
Re: Determine check only one node at parent
What does your function do?
Is it to make only one node checked for whole tree or one node checked for the current level?
-
Oct 26th, 2007, 03:12 AM
#5
Thread Starter
Hyperactive Member
Re: Determine check only one node at parent
I solved the problem.
I unchecked the item by using timer..
Thanks ZeeZee
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Oct 26th, 2007, 03:57 AM
#6
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|