![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hello RandomCoder,
does this code what you are trying to attempt??? Code:
Sub tree_afterselect
If tree.Action="bymouse" Then
node1.value = tree.SelectedNode
Do Until node1.IsRoot
node1.value = node1.parent
Loop
Row = tree.IndexOfNode(node1.value)
Msgbox( "Row "&table1.Cell("ID",Row)&" - "&table1.Cell("Message",Row))
End If
End Sub
specci48 |
|
||||
|
Quote:
![]() Thats exactly what I've been trying to do but without success. Just couldn't get my head round where I was going wrong. Thanks so much, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
I've got a context menu working with my treeview which allows me to switch to different panels, i.e back to the main menu.
But I would also like to use the context menu to perform certain actions on the selected node, such as reply or delete etc. Here is my problem. The AfterSelect event is not triggered by the context menu and so when I select to reply it is acting on the wrong value (node). Attached is a sample code to demonstrate the problem..... Any help, would as ever be greatly appreciated. Thanks, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
Hi RandomCoder,
sorry but I don't have an answer for this avaliable ![]() The Problem is not the AfterSelect event, because if you look carefully, using the context menu e.g. at the 5th entry, the 5th entry is highlited BUT the original node ist still seleced. The still selected node is marked with an outlined box. And after the MsgBox from the context menu is closed, the still selected "original" node is re-highlited again. A reason for this behavior could be that the context menu is added to the whole treeview and not to every single node. So the context menu is treated always the same ignoring on which position you called it. specci48 |
|
||||
|
Hi Specci48,
I too see the problem and tried to force the AfterSelect from within the Context Menu click event but still with no success. After exhausting all my idea's I thought it time to put it to the forum. Erel, do you have any idea's or is it possible to add this feature in a future release? Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
One small addition...
Since some controls behave different on the desktop and on the device (and for the treeview there are A LOT of differences ) I testet your code on the device.The result: On the device the context menu is called with a "tap and hold" action. If I run your original code, calling the context menu DOES select the new node since the device does not know, how long your stylus will be held on the display. The AfterSelect is fired and even overlaps the ContextMenu_Click event so the Sub ContextMenu_Click is never executed. A possible solution for a (device) working code could be: Put all your needed code into the ContextMenu_Click Sub and delete the AfterSelect event... specci48 |
|
||||
|
Thanks, I'll persevere and report back.
One other solution I've just thought of is to trigger the context menu click event using the afterselect of the treeview so that each time a node is selected it displays the context menu allowing the user to choose from the options. Its not ideal but it might work. I've also noticed that if I scroll down the nodes or click on the treeview control (not a node), then a node is highlighted and the afterselect event is fired. Therefore I can record which node it is, BUT if I then tap on that same node there is no way of detecting it. I think that a click event would also be useful for the treeview control. Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
Quote:
![]() I can confirm that I have now got this working by removing the afterselect event and using the context menu. This does mean that I must now tap and hold the node then select an action but at least it performs the action on the correct node. I've requested a Click Event for the treeview control which will resolve this problem, see here http://www.basic4ppc.com/forum/showt...0130#post10130. Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tree View - Help | Cableguy | Questions & Help Needed | 18 | 07-19-2008 01:43 PM |
| Registry to Tree View | willisgt | Questions & Help Needed | 0 | 02-20-2008 05:17 PM |
| Context Menu and Tree View. | RandomCoder | Questions & Help Needed | 4 | 02-18-2008 05:35 PM |
| Canīt view whole Website with PPC Browser | Smurfy2000 | Forum Discussion | 3 | 02-13-2008 09:08 AM |
| Tree View Images | RandomCoder | Questions & Help Needed | 8 | 02-08-2008 05:16 PM |