no visual affect on Tree.selectedNode

Discussion in 'Questions (Windows Mobile)' started by specci48, Sep 2, 2007.

  1. specci48

    specci48 Well-Known Member Licensed User

    This is a question to the .Net experts.

    If I select a node by tabbing on the display (or clicking on a node on the desktop) the node ist selected AND the node gets colored to show the selection.
    If I select a node by coding Tree.selectedNode = ... the node is selected but NOT colored to show the selection. Why?

    I want the user to be able to move a selected node up or down in a treeview. First, the user selects a node by tabbing. The node gets colored and everything is ok.
    Since there is no build in function to move up or down a node, I delete the node and insert it again one position up or down.
    Then I automatically select the moved node in the program so the user could press the up or down button without tabbing on the node again. But my program driven selection is not visible to the user ... so he has to guess which node will move if he presses up or down.

    Any solutions available? :sign0163:


    specci48
     
  2. dzt

    dzt Active Member Licensed User

    Hi there specci48,

    I thing that to see the selection, TreeView should have the focus.
    After Up or DOWN button click, move the focus again to TreeView.

    I hope I helped.

    Regards
     
  3. specci48

    specci48 Well-Known Member Licensed User

    Hi dzt,

    sorry but a treeview has no focus function... :(


    specci48
     
  4. dzt

    dzt Active Member Licensed User

    :signOops::sign0085:
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    The focus method will be added to this control (and other control-libraries as well) as part of the ControlsEx library.
    This should fix the problem you've encountered.
     
  6. dzt

    dzt Active Member Licensed User

    Hi,

    I took it personally.:)

    In then meantime, two workarounds.

    1. If in the form dispose every other (except the TreeView) focus-able control after selecting a TreeView node, then the focus returns to TreeView. After this you can add the controls again at runtime (AddButton etc)

    2. You can use for "UP NODE" and "DOWN NODE" instead of buttons something focus-unable, for example a label, and in that way TreeView won't loose the focus. Look my Clickable Label example here http://www.basic4ppc.com/forum/showthread.php?t=748 at dzEventsMagic thread (post #8).
     
  7. specci48

    specci48 Well-Known Member Licensed User

    Hi dzt,

    I testet workaround 2. with the LinkLabel library and it worked. :)

    Sounds nice. But what is the ControlsEx library? When will it be released? (OK, everytime the same questions...;))


    specci48
     
  8. dzt

    dzt Active Member Licensed User

    Have a look at this thread http://www.basic4ppc.com/forum/showthread.php?t=750

    Maybe it could be someone to stay all night just outside Erel's home and make terrible noise, so he couldn't sleep and stay focused to B4PPC development!

    Maybe I'll try it myself as I am quite near to Israel.:)
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    :)
    It will be released soon (1-2 weeks).
    It is just a library that packs: ScrollBar, TrackBar, TreeView, ProgressBar, TabControl and ToolBar libraries.
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    You can now download the new library and use the Focus method.
     
  11. specci48

    specci48 Well-Known Member Licensed User

    It works perfect :)

    Thank you very much!
    specci48
     
Loading...