Hi!
Access2003, WinXP SP2, Control: MSComctLib.TreeView
I've recently add tree view to my database. Among other functionality it implements Drag-n-Drop. All works fine but one thing.
I want to create drag image from dragged node using Node.CreateDragImage function. But it returns IPictureDisp object containing a node image only, never the node text nothing to tell about a composite one I would like to see.
Any helpful advice will be appreciated.
Thanks.
11 8012 NeoPa 32,556
Expert Mod 16PB
Hi!
Access2003, WinXP SP2, Control: MSComctLib.TreeView
I've recently add tree view to my database. Among other functionality it implements Drag-n-Drop. All works fine but one thing.
I want to create drag image from dragged node using Node.CreateDragImage function. But it returns IPictureDisp object containing a node image only, never the node text nothing to tell about a composite one I would like to see.
Any helpful advice will be appreciated.
Thanks.
Fish,
You may be lucky here and find someone who knows about this software, but the expertise is generally around MS Access rather than specific add-ons.
Good luck anyway.
Fish,
You may be lucky here and find someone who knows about this software, but the expertise is generally around MS Access rather than specific add-ons.
Good luck anyway.
Hmmm. You consider Treeview control is less native to Access than for example Chart control? :)
Anyway thanks.
NeoPa 32,556
Expert Mod 16PB
Hmmm. You consider Treeview control is less native to Access than for example Chart control? :)
Anyway thanks.
I'm not saying you won't get an answer, just that the chances are less because it's less common usage. I don't know it at all personally - is it a M$ add-in then? Is it included in the base Access package even? If it is either of these then it's more likely you'll find an answer (not from me though 'cause I've not even heard of it before :D).
I'm not saying you won't get an answer, just that the chances are less because it's less common usage. I don't know it at all personally - is it a M$ add-in then? Is it included in the base Access package even? If it is either of these then it's more likely you'll find an answer (not from me though 'cause I've not even heard of it before :D).
It is in
"Microsoft Windows Common Controls 6.0 (SP6)"
\WINDOWS\system32\MSCOMCTL.OCX
MSDN documentation is minor.
Well. Maybe I should create mouseicon programmatically.
Really, I don't wait for solutions but for ideas.
Programming is much more interesting thing than program itself, isn't it?
Hi!
Access2003, WinXP SP2, Control: MSComctLib.TreeView
I've recently add tree view to my database. Among other functionality it implements Drag-n-Drop. All works fine but one thing.
I want to create drag image from dragged node using Node.CreateDragImage function. But it returns IPictureDisp object containing a node image only, never the node text nothing to tell about a composite one I would like to see.
Any helpful advice will be appreciated.
Thanks.
I'm familiar with VB but I need to see your code in order to attempt a response. - Are you using Manual or Automatic Drag-N-Drop operations?
- If you are manually using Drag-N-Drop, have you initiated the Drag operation via the Drag Method?
- What are your settings for the OLEDragMode and OLEDropMode Propeerties?
- How are you initializing the CreateDragImage Method (TreeViewName.SelectedItem.CreateImage)?
- This Method creates a dithered version of an Object's Image. What are you assigning this Image to?
- The Node selected for Drag Operations - is it declared Publically?
- Please post all relevant code.
I'm familiar with VB but I need to see your code in order to attempt a response. - Are you using Manual or Automatic Drag-N-Drop operations?
- If you are manually using Drag-N-Drop, have you initiated the Drag operation via the Drag Method?
- What are your settings for the OLEDragMode and OLEDropMode Propeerties?
- How are you initializing the CreateDragImage Method (TreeViewName.SelectedItem.CreateImage)?
- This Method creates a dithered version of an Object's Image. What are you assigning this Image to?
- The Node selected for Drag Operations - is it declared Publically?
- Please post all relevant code.
Hi! Thanks for cooperation. Hereby I'm providing code of Drag events handlers.
It is located in custom Class module as you can see. Treeview object is a global variable in Class module and is retrived via Me.TreeView property. -
-
Private Sub trvTreeView_OLEDragDrop(Data As MSComctlLib.DataObject, _
-
Effect As Long, Button As Integer, Shift As Integer, _
-
x As Single, y As Single)
-
-
With Me.TreeView
-
DragCompleted .SelectedItem, .HitTest(x, y), Shift
-
.DropHighlight = Nothing
-
.MousePointer = ccArrow
-
End With
-
-
End Sub
-
-
Private Sub trvTreeView_OLEDragOver(Data As MSComctlLib.DataObject, _
-
Effect As Long, Button As Integer, Shift As Integer, _
-
x As Single, y As Single, State As Integer)
-
-
With Me.TreeView
-
If .SelectedItem Is Nothing Then
-
.SelectedItem = .HitTest(x, y)
-
.MouseIcon = .SelectedItem.CreateDragImage
-
.MousePointer = ccCustom
-
End If
-
.DropHighlight = .HitTest(x, y)
-
End With
-
If (Shift And 2) = 0 Then
-
Effect = ccOLEDropEffectMove
-
Else
-
Effect = ccOLEDropEffectCopy
-
End If
-
-
End Sub
-
-
Private Sub trvTreeView_OLEGiveFeedback(Effect As Long, _
-
DefaultCursors As Boolean)
-
DefaultCursors = False
-
End Sub
-
-
Private Sub trvTreeView_OLEStartDrag(Data As MSComctlLib.DataObject, _
-
AllowedEffects As Long)
-
-
Me.TreeView.SelectedItem = Nothing
-
AllowedEffects = ccOLEDropEffectCopy + ccOLEDropEffectMove
-
-
End Sub
-
-
Drag properties are the following:
.OLEDragMode = ccOLEDragAutomatic
.OLEDropMode = ccOLEDropManual
As I've already stated the result is that mouse cursor image changes to Node.Image with low resolution.
If Node object contains no Image and TreeView.Style=tvwTreelinesPlusMinusText CreateDragImage method returns empty bar image.
Actually I'm thinking about manual image creation instead of CreateDragImage method. Could you suggest how to create IPictureDisp object from text? Maybe some WinAPI function?
Thanks.
Hi! Thanks for cooperation. Hereby I'm providing code of Drag events handlers.
It is located in custom Class module as you can see. Treeview object is a global variable in Class module and is retrived via Me.TreeView property. -
-
Private Sub trvTreeView_OLEDragDrop(Data As MSComctlLib.DataObject, _
-
Effect As Long, Button As Integer, Shift As Integer, _
-
x As Single, y As Single)
-
-
With Me.TreeView
-
DragCompleted .SelectedItem, .HitTest(x, y), Shift
-
.DropHighlight = Nothing
-
.MousePointer = ccArrow
-
End With
-
-
End Sub
-
-
Private Sub trvTreeView_OLEDragOver(Data As MSComctlLib.DataObject, _
-
Effect As Long, Button As Integer, Shift As Integer, _
-
x As Single, y As Single, State As Integer)
-
-
With Me.TreeView
-
If .SelectedItem Is Nothing Then
-
.SelectedItem = .HitTest(x, y)
-
.MouseIcon = .SelectedItem.CreateDragImage
-
.MousePointer = ccCustom
-
End If
-
.DropHighlight = .HitTest(x, y)
-
End With
-
If (Shift And 2) = 0 Then
-
Effect = ccOLEDropEffectMove
-
Else
-
Effect = ccOLEDropEffectCopy
-
End If
-
-
End Sub
-
-
Private Sub trvTreeView_OLEGiveFeedback(Effect As Long, _
-
DefaultCursors As Boolean)
-
DefaultCursors = False
-
End Sub
-
-
Private Sub trvTreeView_OLEStartDrag(Data As MSComctlLib.DataObject, _
-
AllowedEffects As Long)
-
-
Me.TreeView.SelectedItem = Nothing
-
AllowedEffects = ccOLEDropEffectCopy + ccOLEDropEffectMove
-
-
End Sub
-
-
Drag properties are the following:
.OLEDragMode = ccOLEDragAutomatic
.OLEDropMode = ccOLEDropManual
As I've already stated the result is that mouse cursor image changes to Node.Image with low resolution.
If Node object contains no Image and TreeView.Style=tvwTreelinesPlusMinusText CreateDragImage method returns empty bar image.
Actually I'm thinking about manual image creation instead of CreateDragImage method. Could you suggest how to create IPictureDisp object from text? Maybe some WinAPI function?
Thanks.
- Is the TreeView Property setting an explicit reference to tvwTreeView, and not a TreeView Object?
- Shouldn't there be some kind of specific reference to the actual Node being dragged in the MouseDown () Event? e.g.
- Private Sub TreeView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
-
Set MyNode = Me.TreeView.SelectedItem
-
End Sub
- I definitely think that it is a bad idea to use 'TreeView' as a Custom Property. There could be some ambiguity - did you try changing this Property Name?
- A Picture Object implements an iPictureDisp Interface in order to provide access to trhe Picture's properties through Automation.From what I have researched, this interface is not meant to be implemented since there is an OLE-provided Picture Object. For all practical purposes, all properties contained within iPictureDisp are Read Only. I'm sure that an API Function exists to create one, but I have no idea of its name.
- Is the TreeView Property setting an explicit reference to tvwTreeView, and not a TreeView Object?
- Shouldn't there be some kind of specific reference to the actual Node being dragged in the MouseDown () Event? e.g.
- Private Sub TreeView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
-
Set MyNode = Me.TreeView.SelectedItem
-
End Sub
- I definitely think that it is a bad idea to use 'TreeView' as a Custom Property. There could be some ambiguity - did you try changing this Property Name?
- A Picture Object implements an iPictureDisp Interface in order to provide access to trhe Picture's properties through Automation.From what I have researched, this interface is not meant to be implemented since there is an OLE-provided Picture Object. For all practical purposes, all properties contained within iPictureDisp are Read Only. I'm sure that an API Function exists to create one, but I have no idea of its name.
Thanks. - Surely TreeView property references TreeView object, not a trvTreeView control
- What concerns referencing Node object, I'm 100% sure having debugged this that the referenced object is a right one
- "TreeView" name of the custom class property does not conflict with class name TreeView, you can find many examples when a property returning particulary object has the same name as the object class has.
- Finally, I've tried the folowing code after the tree has been populated, not in Drag-n-Drop context:
-
-
Dim pic As stdole.IPictureDisp
-
........................
-
Set pic = .Nodes(2).CreateDragImage
-
SavePicture pic, "C:\pic.dib"
-
Set pic = Nothing
-
.......................
-
No way. Opened it in Paintbrush - image corresponding to the node, no text.
I think I will try search WinAPI. This seems to be more promissing.
Anyway thanks.
I do realise this thread is ancient, but I also know both of you are still active on the forum. Did you ever find a way to create a composite image of the node icon and caption? I've been searching myself, and trying myself with no luck.
Sorry TheSmileyCode, no luck on this end. I'll have a fresh look later on and see if anything comes up.
Thank you for replying ADezii. The best I have come up with myself is to use the OLEDragOver to continously remove the node, and add it at the location of the mouse. (I have to remove it and add it again, since I cannot change its index at runtime)
It almost looks like dragging, but its not perfect, I would prefer the CreateDragImage to work.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Robert Robinson |
last post by:
I have been working for the past week on what seems to be a bug with
the VB TreeView control. I have changed the background of the treeview
to a light beige, this works fine except for the white...
|
by: MarkD |
last post by:
I have an ASP.NET (VB.NET) application that calls all VB6 COM DLL via
Interop. The DLL uses functionality contained in a Custom OCX Control
(Also VB6) that in turn contains a standard TreeView...
|
by: Evan Kontos |
last post by:
I am trying to implement a Treeview w/an XML file and I even copied and
pasted examples from MSDN but can't get them to work. Any suggestions
welcome.
XML File
<TREENODES>
<TREENODE...
|
by: L.M |
last post by:
Hello,
I knew how to use the treeview under VB6. After migrating to .NET, well, I'm
lost.
I try to add a new node, either to the same level or as a child to a
selected node in the treeview....
|
by: Tymbow |
last post by:
I'm building a web application that is analogous to the Windows XP file
explorer in function. The left column contains a TreeView, and the right
column a DataGrid populated by selecting TreeView...
|
by: cyriel1920 |
last post by:
Hi,
I use the selectednodestyle with a white background so the user can see
which item was chosen in the treeview navigation.
The nodes have a navigateURL with a target to another frame....
|
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...
|
by: Nikron |
last post by:
Hi,
I'm having an issue with the ASP.NET 2.0 Treeview control and persisting
its' state accross requests. My Control is embedded within a master page
and is used for site navigation. My problem...
|
by: makennedy |
last post by:
Hi Experts,
Please help, I am a newbie to ASP.NET 2.0 may be I am doing something wrong or there may be a bug somewhere.
Basically I have a TreeView Control which I have created...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
|
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...
| |