TreeView Question Part Deux

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael C

    TreeView Question Part Deux

    Hi all,

    I half-resolved my previous TreeView issue. Now I was wondering if anyone
    knows of a way to keep a TreeNode from being highlighted when it is
    left-clicked? It seems like there should be an event I could intercept, or
    a property I could set, but I'll be darned if I can figure out which one...

    Thanks,
    Michael C., MCDBA


  • Vijaye Raji

    #2
    Re: TreeView Question Part Deux

    You can hook on "BeforeSele ct" event and set the Cancel property on
    TreeViewCancelE ventArgs to true.

    -vJ

    "Michael C" <michaelco@opto nline.net> wrote in message
    news:eK1Ly1PlEH A.3912@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hi all,
    >
    > I half-resolved my previous TreeView issue. Now I was wondering if anyone
    > knows of a way to keep a TreeNode from being highlighted when it is
    > left-clicked? It seems like there should be an event I could intercept,
    > or
    > a property I could set, but I'll be darned if I can figure out which
    > one...
    >
    > Thanks,
    > Michael C., MCDBA
    >
    >[/color]


    Comment

    • Michael C

      #3
      Re: TreeView Question Part Deux

      Tried that, it didn't work :(

      Thanks,
      Michael C., MCDBA

      "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
      news:enRcEwSlEH A.3452@TK2MSFTN GP15.phx.gbl...[color=blue]
      > You can hook on "BeforeSele ct" event and set the Cancel property on
      > TreeViewCancelE ventArgs to true.
      >
      > -vJ
      >
      > "Michael C" <michaelco@opto nline.net> wrote in message
      > news:eK1Ly1PlEH A.3912@TK2MSFTN GP12.phx.gbl...[color=green]
      > > Hi all,
      > >
      > > I half-resolved my previous TreeView issue. Now I was wondering if[/color][/color]
      anyone[color=blue][color=green]
      > > knows of a way to keep a TreeNode from being highlighted when it is
      > > left-clicked? It seems like there should be an event I could intercept,
      > > or
      > > a property I could set, but I'll be darned if I can figure out which
      > > one...
      > >
      > > Thanks,
      > > Michael C., MCDBA
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Michael C

        #4
        Re: TreeView Question Part Deux

        I *think* it doesn't work because right-clicking a node doesn't fire the
        BeforeSelect and AfterSelect events (maybe because right-clicking doesn't
        actually select a node?) I just tried it again, just to make sure, and it
        appears right-clicking doesn't fire BeforeSelect.

        Thanks,
        Michael C., MCDBA

        "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
        news:enRcEwSlEH A.3452@TK2MSFTN GP15.phx.gbl...[color=blue]
        > You can hook on "BeforeSele ct" event and set the Cancel property on
        > TreeViewCancelE ventArgs to true.
        >
        > -vJ
        >
        > "Michael C" <michaelco@opto nline.net> wrote in message
        > news:eK1Ly1PlEH A.3912@TK2MSFTN GP12.phx.gbl...[color=green]
        > > Hi all,
        > >
        > > I half-resolved my previous TreeView issue. Now I was wondering if[/color][/color]
        anyone[color=blue][color=green]
        > > knows of a way to keep a TreeNode from being highlighted when it is
        > > left-clicked? It seems like there should be an event I could intercept,
        > > or
        > > a property I could set, but I'll be darned if I can figure out which
        > > one...
        > >
        > > Thanks,
        > > Michael C., MCDBA
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Vijaye Raji

          #5
          Re: TreeView Question Part Deux

          Right-clicking does fire the BeforeSelect event on mine. I'm using .Net
          1.1.

          -vJ

          "Michael C" <michaelc@nospa m.org> wrote in message
          news:cjr%c.2031 5$kY1.6369693@n ews4.srv.hcvlny .cv.net...[color=blue]
          >I *think* it doesn't work because right-clicking a node doesn't fire the
          > BeforeSelect and AfterSelect events (maybe because right-clicking doesn't
          > actually select a node?) I just tried it again, just to make sure, and it
          > appears right-clicking doesn't fire BeforeSelect.
          >
          > Thanks,
          > Michael C., MCDBA
          >
          > "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
          > news:enRcEwSlEH A.3452@TK2MSFTN GP15.phx.gbl...[color=green]
          >> You can hook on "BeforeSele ct" event and set the Cancel property on
          >> TreeViewCancelE ventArgs to true.
          >>
          >> -vJ
          >>
          >> "Michael C" <michaelco@opto nline.net> wrote in message
          >> news:eK1Ly1PlEH A.3912@TK2MSFTN GP12.phx.gbl...[color=darkred]
          >> > Hi all,
          >> >
          >> > I half-resolved my previous TreeView issue. Now I was wondering if[/color][/color]
          > anyone[color=green][color=darkred]
          >> > knows of a way to keep a TreeNode from being highlighted when it is
          >> > left-clicked? It seems like there should be an event I could
          >> > intercept,
          >> > or
          >> > a property I could set, but I'll be darned if I can figure out which
          >> > one...
          >> >
          >> > Thanks,
          >> > Michael C., MCDBA
          >> >
          >> >[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          • Michael C

            #6
            Re: TreeView Question Part Deux

            I'm using .NET 1.1 also, VS.NET 2003 -- I wired up the BeforeSelect event
            and the MouseDown events, and the right-click just isn't firing the
            BeforeSelect here... hmmm... I can probably live without that part, it's
            just a little annoying is all. Now I'm having an issue with trying to
            display a pop-up Context Menu on the right-click. It pops up OK, but until
            you click somewhere else on the form to get rid of the Context Menu, you
            can't right-click again... I'd like to figure out how to make the Context
            Menu close out and pop back up as soon as you right-click anywhere on the
            form, whether the menu is up or not... Guess I need to look at ContextMenu
            events next.

            Geez, everytime I figure out one thing, I have to look up 3 others.

            Thanks,
            Michael C., MCDBA

            "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
            news:OuwFlITlEH A.208@TK2MSFTNG P12.phx.gbl...[color=blue]
            > Right-clicking does fire the BeforeSelect event on mine. I'm using .Net
            > 1.1.
            >
            > -vJ
            >
            > "Michael C" <michaelc@nospa m.org> wrote in message
            > news:cjr%c.2031 5$kY1.6369693@n ews4.srv.hcvlny .cv.net...[color=green]
            > >I *think* it doesn't work because right-clicking a node doesn't fire the
            > > BeforeSelect and AfterSelect events (maybe because right-clicking[/color][/color]
            doesn't[color=blue][color=green]
            > > actually select a node?) I just tried it again, just to make sure, and[/color][/color]
            it[color=blue][color=green]
            > > appears right-clicking doesn't fire BeforeSelect.
            > >
            > > Thanks,
            > > Michael C., MCDBA
            > >
            > > "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
            > > news:enRcEwSlEH A.3452@TK2MSFTN GP15.phx.gbl...[color=darkred]
            > >> You can hook on "BeforeSele ct" event and set the Cancel property on
            > >> TreeViewCancelE ventArgs to true.
            > >>
            > >> -vJ
            > >>
            > >> "Michael C" <michaelco@opto nline.net> wrote in message
            > >> news:eK1Ly1PlEH A.3912@TK2MSFTN GP12.phx.gbl...
            > >> > Hi all,
            > >> >
            > >> > I half-resolved my previous TreeView issue. Now I was wondering if[/color]
            > > anyone[color=darkred]
            > >> > knows of a way to keep a TreeNode from being highlighted when it is
            > >> > left-clicked? It seems like there should be an event I could
            > >> > intercept,
            > >> > or
            > >> > a property I could set, but I'll be darned if I can figure out which
            > >> > one...
            > >> >
            > >> > Thanks,
            > >> > Michael C., MCDBA
            > >> >
            > >> >
            > >>
            > >>[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Vijaye Raji

              #7
              Re: TreeView Question Part Deux

              Context menu should work as it is, unless you're handling the Mouse Down
              events in a specific way and that is interfering with the other events.

              That could also explain why I get the BeforeSelect and you don't.

              -vJ

              "Michael C" <michaelc@nospa m.org> wrote in message
              news:gQs%c.2076 5$kY1.6669150@n ews4.srv.hcvlny .cv.net...[color=blue]
              > I'm using .NET 1.1 also, VS.NET 2003 -- I wired up the BeforeSelect event
              > and the MouseDown events, and the right-click just isn't firing the
              > BeforeSelect here... hmmm... I can probably live without that part, it's
              > just a little annoying is all. Now I'm having an issue with trying to
              > display a pop-up Context Menu on the right-click. It pops up OK, but
              > until
              > you click somewhere else on the form to get rid of the Context Menu, you
              > can't right-click again... I'd like to figure out how to make the Context
              > Menu close out and pop back up as soon as you right-click anywhere on the
              > form, whether the menu is up or not... Guess I need to look at
              > ContextMenu
              > events next.
              >
              > Geez, everytime I figure out one thing, I have to look up 3 others.
              >
              > Thanks,
              > Michael C., MCDBA
              >
              > "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
              > news:OuwFlITlEH A.208@TK2MSFTNG P12.phx.gbl...[color=green]
              >> Right-clicking does fire the BeforeSelect event on mine. I'm using .Net
              >> 1.1.
              >>
              >> -vJ
              >>
              >> "Michael C" <michaelc@nospa m.org> wrote in message
              >> news:cjr%c.2031 5$kY1.6369693@n ews4.srv.hcvlny .cv.net...[color=darkred]
              >> >I *think* it doesn't work because right-clicking a node doesn't fire the
              >> > BeforeSelect and AfterSelect events (maybe because right-clicking[/color][/color]
              > doesn't[color=green][color=darkred]
              >> > actually select a node?) I just tried it again, just to make sure, and[/color][/color]
              > it[color=green][color=darkred]
              >> > appears right-clicking doesn't fire BeforeSelect.
              >> >
              >> > Thanks,
              >> > Michael C., MCDBA
              >> >
              >> > "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
              >> > news:enRcEwSlEH A.3452@TK2MSFTN GP15.phx.gbl...
              >> >> You can hook on "BeforeSele ct" event and set the Cancel property on
              >> >> TreeViewCancelE ventArgs to true.
              >> >>
              >> >> -vJ
              >> >>
              >> >> "Michael C" <michaelco@opto nline.net> wrote in message
              >> >> news:eK1Ly1PlEH A.3912@TK2MSFTN GP12.phx.gbl...
              >> >> > Hi all,
              >> >> >
              >> >> > I half-resolved my previous TreeView issue. Now I was wondering if
              >> > anyone
              >> >> > knows of a way to keep a TreeNode from being highlighted when it is
              >> >> > left-clicked? It seems like there should be an event I could
              >> >> > intercept,
              >> >> > or
              >> >> > a property I could set, but I'll be darned if I can figure out which
              >> >> > one...
              >> >> >
              >> >> > Thanks,
              >> >> > Michael C., MCDBA
              >> >> >
              >> >> >
              >> >>
              >> >>
              >> >
              >> >[/color]
              >>
              >>[/color]
              >
              >[/color]


              Comment

              • Michael C

                #8
                Re: TreeView Question Part Deux

                By golly you're probably right... I am intercepting the MouseDown event,
                although I'm not doing anything I would think would interfere with the other
                events... I even tried calling the base.OnMouseDow n(e) event in my own
                MouseDown event handler, but it still seems to be interfering... strange...
                I think I found a workaround, basically using the ContextMenu PopUp event to
                handle everything; stranger and stranger. It seems like a simple thing I
                want to do, but it gets more and more complicated as I go.

                Thanks,
                Michael C., MCDBA

                "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
                news:Oz1VWjblEH A.2140@TK2MSFTN GP15.phx.gbl...[color=blue]
                > Context menu should work as it is, unless you're handling the Mouse Down
                > events in a specific way and that is interfering with the other events.
                >
                > That could also explain why I get the BeforeSelect and you don't.
                >
                > -vJ
                >
                > "Michael C" <michaelc@nospa m.org> wrote in message
                > news:gQs%c.2076 5$kY1.6669150@n ews4.srv.hcvlny .cv.net...[color=green]
                > > I'm using .NET 1.1 also, VS.NET 2003 -- I wired up the BeforeSelect[/color][/color]
                event[color=blue][color=green]
                > > and the MouseDown events, and the right-click just isn't firing the
                > > BeforeSelect here... hmmm... I can probably live without that part,[/color][/color]
                it's[color=blue][color=green]
                > > just a little annoying is all. Now I'm having an issue with trying to
                > > display a pop-up Context Menu on the right-click. It pops up OK, but
                > > until
                > > you click somewhere else on the form to get rid of the Context Menu, you
                > > can't right-click again... I'd like to figure out how to make the[/color][/color]
                Context[color=blue][color=green]
                > > Menu close out and pop back up as soon as you right-click anywhere on[/color][/color]
                the[color=blue][color=green]
                > > form, whether the menu is up or not... Guess I need to look at
                > > ContextMenu
                > > events next.
                > >
                > > Geez, everytime I figure out one thing, I have to look up 3 others.
                > >
                > > Thanks,
                > > Michael C., MCDBA
                > >
                > > "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
                > > news:OuwFlITlEH A.208@TK2MSFTNG P12.phx.gbl...[color=darkred]
                > >> Right-clicking does fire the BeforeSelect event on mine. I'm using[/color][/color][/color]
                ..Net[color=blue][color=green][color=darkred]
                > >> 1.1.
                > >>
                > >> -vJ
                > >>
                > >> "Michael C" <michaelc@nospa m.org> wrote in message
                > >> news:cjr%c.2031 5$kY1.6369693@n ews4.srv.hcvlny .cv.net...
                > >> >I *think* it doesn't work because right-clicking a node doesn't fire[/color][/color][/color]
                the[color=blue][color=green][color=darkred]
                > >> > BeforeSelect and AfterSelect events (maybe because right-clicking[/color]
                > > doesn't[color=darkred]
                > >> > actually select a node?) I just tried it again, just to make sure,[/color][/color][/color]
                and[color=blue][color=green]
                > > it[color=darkred]
                > >> > appears right-clicking doesn't fire BeforeSelect.
                > >> >
                > >> > Thanks,
                > >> > Michael C., MCDBA
                > >> >
                > >> > "Vijaye Raji" <no_spam_vganes h@hotmail.com> wrote in message
                > >> > news:enRcEwSlEH A.3452@TK2MSFTN GP15.phx.gbl...
                > >> >> You can hook on "BeforeSele ct" event and set the Cancel property on
                > >> >> TreeViewCancelE ventArgs to true.
                > >> >>
                > >> >> -vJ
                > >> >>
                > >> >> "Michael C" <michaelco@opto nline.net> wrote in message
                > >> >> news:eK1Ly1PlEH A.3912@TK2MSFTN GP12.phx.gbl...
                > >> >> > Hi all,
                > >> >> >
                > >> >> > I half-resolved my previous TreeView issue. Now I was wondering[/color][/color][/color]
                if[color=blue][color=green][color=darkred]
                > >> > anyone
                > >> >> > knows of a way to keep a TreeNode from being highlighted when it[/color][/color][/color]
                is[color=blue][color=green][color=darkred]
                > >> >> > left-clicked? It seems like there should be an event I could
                > >> >> > intercept,
                > >> >> > or
                > >> >> > a property I could set, but I'll be darned if I can figure out[/color][/color][/color]
                which[color=blue][color=green][color=darkred]
                > >> >> > one...
                > >> >> >
                > >> >> > Thanks,
                > >> >> > Michael C., MCDBA
                > >> >> >
                > >> >> >
                > >> >>
                > >> >>
                > >> >
                > >> >
                > >>
                > >>[/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                Working...