473,503 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Nov 16 '05 #1
7 2085
You can hook on "BeforeSelect" event and set the Cancel property on
TreeViewCancelEventArgs to true.

-vJ

"Michael C" <mi*******@optonline.net> wrote in message
news:eK**************@TK2MSFTNGP12.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

Nov 16 '05 #2
Tried that, it didn't work :(

Thanks,
Michael C., MCDBA

"Vijaye Raji" <no*************@hotmail.com> wrote in message
news:en**************@TK2MSFTNGP15.phx.gbl...
You can hook on "BeforeSelect" event and set the Cancel property on
TreeViewCancelEventArgs to true.

-vJ

"Michael C" <mi*******@optonline.net> wrote in message
news:eK**************@TK2MSFTNGP12.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


Nov 16 '05 #3
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*************@hotmail.com> wrote in message
news:en**************@TK2MSFTNGP15.phx.gbl...
You can hook on "BeforeSelect" event and set the Cancel property on
TreeViewCancelEventArgs to true.

-vJ

"Michael C" <mi*******@optonline.net> wrote in message
news:eK**************@TK2MSFTNGP12.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


Nov 16 '05 #4
Right-clicking does fire the BeforeSelect event on mine. I'm using .Net
1.1.

-vJ

"Michael C" <mi******@nospam.org> wrote in message
news:cj*********************@news4.srv.hcvlny.cv.n et...
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*************@hotmail.com> wrote in message
news:en**************@TK2MSFTNGP15.phx.gbl...
You can hook on "BeforeSelect" event and set the Cancel property on
TreeViewCancelEventArgs to true.

-vJ

"Michael C" <mi*******@optonline.net> wrote in message
news:eK**************@TK2MSFTNGP12.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
>
>



Nov 16 '05 #5
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*************@hotmail.com> wrote in message
news:Ou*************@TK2MSFTNGP12.phx.gbl...
Right-clicking does fire the BeforeSelect event on mine. I'm using .Net
1.1.

-vJ

"Michael C" <mi******@nospam.org> wrote in message
news:cj*********************@news4.srv.hcvlny.cv.n et...
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*************@hotmail.com> wrote in message
news:en**************@TK2MSFTNGP15.phx.gbl...
You can hook on "BeforeSelect" event and set the Cancel property on
TreeViewCancelEventArgs to true.

-vJ

"Michael C" <mi*******@optonline.net> wrote in message
news:eK**************@TK2MSFTNGP12.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
>
>



Nov 16 '05 #6
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" <mi******@nospam.org> wrote in message
news:gQ*********************@news4.srv.hcvlny.cv.n et...
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*************@hotmail.com> wrote in message
news:Ou*************@TK2MSFTNGP12.phx.gbl...
Right-clicking does fire the BeforeSelect event on mine. I'm using .Net
1.1.

-vJ

"Michael C" <mi******@nospam.org> wrote in message
news:cj*********************@news4.srv.hcvlny.cv.n et...
>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*************@hotmail.com> wrote in message
> news:en**************@TK2MSFTNGP15.phx.gbl...
>> You can hook on "BeforeSelect" event and set the Cancel property on
>> TreeViewCancelEventArgs to true.
>>
>> -vJ
>>
>> "Michael C" <mi*******@optonline.net> wrote in message
>> news:eK**************@TK2MSFTNGP12.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
>> >
>> >
>>
>>
>
>



Nov 16 '05 #7
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.OnMouseDown(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*************@hotmail.com> wrote in message
news:Oz**************@TK2MSFTNGP15.phx.gbl...
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" <mi******@nospam.org> wrote in message
news:gQ*********************@news4.srv.hcvlny.cv.n et...
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*************@hotmail.com> wrote in message
news:Ou*************@TK2MSFTNGP12.phx.gbl...
Right-clicking does fire the BeforeSelect event on mine. I'm using ..Net 1.1.

-vJ

"Michael C" <mi******@nospam.org> wrote in message
news:cj*********************@news4.srv.hcvlny.cv.n et...
>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*************@hotmail.com> wrote in message
> news:en**************@TK2MSFTNGP15.phx.gbl...
>> You can hook on "BeforeSelect" event and set the Cancel property on
>> TreeViewCancelEventArgs to true.
>>
>> -vJ
>>
>> "Michael C" <mi*******@optonline.net> wrote in message
>> news:eK**************@TK2MSFTNGP12.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
>> >
>> >
>>
>>
>
>



Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1841
by: Vibor | last post by:
Hello, I have XML file that looks likes this: <?xml version="1.0" encoding="utf-8" ?> <prezentacije> <datoteka naziv="Koherentni valovi"...
3
2817
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%""...
4
1366
by: Martin | last post by:
I have a treeview control, which is docked on a panel. When I call the procedure to fill this treeview from the load event it works fine. It loads all nodes, and displays them nicely. However,...
6
20917
by: PeteCresswell | last post by:
I've just added a new record to the backend DB and reloaded the TreeView that shows the user all records in the DB. Now I want to programatically position the TreeView at the newly-added record...
1
3637
by: Victor Rodriguez | last post by:
Is there a way that I can have a client side event like oncontextmenu="showfunction();" on each node? thanks, Victor
8
12726
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
0
2270
by: drop | last post by:
Hi, I'm currently working with the Treeview control in ASP .Net 2.0. The tree is filled dynamically based on data contained in a MySQL Database. Here is the exact behavior I want : 1 - User...
1
5602
by: aaronh64 | last post by:
I'm trying to bind to the ASP.NET TreeView control and utilize the PopulateOnDemand functionality. However, I am receiving the following (very confusing) error: "PopulateOnDemand only supported...
2
3571
by: Jenifer.Austin | last post by:
MS Access 2000 I have created a large treeview control based on lists of parts. The nodekey for a part consists of a character followed by the parent part's index. Some of these parts (e.g.,...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7064
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.