473,474 Members | 1,682 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to HighLight the Drag-Drop Node in TreeView ?

There is DropHighlight prop when DropDrag in VB6,

how to implement in VB.NET or C# ?

thanks
Nov 20 '05 #1
3 10739

Use the DragOver event to determine what you are dragging over - (as you
should anyway to determine whether its ok to do so) and then set the current
item as the selected item (something like this - )

Private Sub TreeView_DragOver(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles TreeView.DragOver
' Assume we can't drop

' Ok, are we currently over a tree node?

Dim mousePos As Point
mousePos = TreeView.PointToClient(Cursor.Position)

Dim nodeOver As MultiSelectTreeViewNode =
CType(TreeView.GetNodeAt(mousePos), MultiSelectTreeViewNode)

If nodeOver Is Nothing Then
Exit Sub
Else
TreeView.SelectedNode = nodeOver
end if
end sub
Nov 20 '05 #2
but the "TreeView.SelectedNode = nodeOver" will fire the After_SelectChanged
events,

I place the fill listview code in this event,

I want not the event happen when Drop-Drap
Nov 20 '05 #3
Well, yes it will - there is no other way of doing it, unless you store the
current node (nodeOver), change its colour manually then next time you go
into the onDragDrop you change the colour back before storing the new one.

"jiatiejun" <ji*****@263.net> wrote in message
news:u0**************@TK2MSFTNGP10.phx.gbl...
but the "TreeView.SelectedNode = nodeOver" will fire the After_SelectChanged events,

I place the fill listview code in this event,

I want not the event happen when Drop-Drap

Nov 20 '05 #4

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

Similar topics

13
by: David Morgan | last post by:
Hello I have a little function to highlight text if it exists. Function Highlight(vFind, vSearch) Dim RegEx Set RegEx = New RegExp RegEx.Pattern = vFind RegEx.IgnoreCase = True Highlight =...
2
by: Guoqi Zheng | last post by:
Dear sir, I am writting an WYSIWYG html editor, I need to get the html source code out of an iframe. I know I can use innerhtml or innertext. But that will remvoe the html header info which is...
3
by: mitch | last post by:
Suppose you have an HTML table with 2 rows 1 2 3 4 5 6 7 8 and you click the cell with the 2 and drag to the cell with the 7. You will see the items 2 3 4 5 6 7 highlighted. This is sort of...
9
by: Devron Blatchford | last post by:
Hi there, Just wondering if I change the back and fore colour of a listview item when the mouse hovers over it? I want to overide the default windows colour. Can someone please tell me how to...
5
by: Atara | last post by:
I am trying to convert the following code to VB .Net, I still have some gaps (the lines that are marked with (*)) and also I need an ending condition for the while loop. any help would be...
2
by: Number 11950 - GPEMC! Replace number with 11950 | last post by:
When you highlight a selection of text represented in an object on a form, somewhere in the Framework or alternatively in the Windows API there exists an array of variables that either contain as a...
2
by: Celeste | last post by:
Hello, I'm trying to parse the referring url for google search terms so that when this page loads it will scroll to and highlight the search term(s). Should i be using document.referrer? ...
0
Merlin1857
by: Merlin1857 | last post by:
A thing I have been asked for on a number of occasions is the ability to highlight text after its been searched for in a record return page. The following does this perfectly. Use this function...
4
by: Andrew Poulos | last post by:
As a user tabs about a web page I want to highlight with a, say, 2 pixel solid yellow border the anchor that currently has focus. When the anchor loses focus the border is removed. The anchors...
0
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
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
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...
0
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.