?
Solved

ToolTip and TreeView

Posted on 2010-09-10
9
Medium Priority
?
519 Views
Last Modified: 2012-05-10
Hi,

Is there any way to hide the ToolTips for TreeView?

Thanks!
SP
0
Comment
Question by:Nirmal Sharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 43

Assisted Solution

by:pcelba
pcelba earned 200 total points
ID: 33647255
Are you able to see all TreeView properties? Does any of them say something about tooltips?

And did you ask TreeView author already?
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 33647361
I'm using the example given here: http://fox.wikis.com/wc.dll?Wiki~TreeView

and the example given here to hide tooltips does not see to work:

#DEFINE TVS_NOTOOLTIPS 128
#DEFINE GWL_STYLE -16
DECLARE INTEGER SetWindowLong IN WIN32API INTEGER, INTEGER, INTEGER
DECLARE INTEGER GetWindowLong IN WIN32API INTEGER, INTEGER

LOCAL lnRet, lnHwnd
lnHwnd = THISFORM.yourTreeView.hWnd
lnRet = SetWindowLong(lnHwnd,GWL_STYLE, BITOR(TVS_NOTOOLTIPS,GetWindowLong(lnHwnd,GWL_STYLE)))

When I use the above example it says: The object TreeViewName is not evaluated to an object.


Thanks!
SP
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 33648318
You need to change "yourTreeView" to the real of your treeview. Is it so hard to see that this is just a placeholder? The author of that code does not know how your treeview object is named.

The code just turns off tipp texts for a hwnd window handle, which each activeX control has, so this works with no matter what activeX treeview, but you need to apply the name the treeview has in your form, most probably that will be thisform.olecontrol1 instead.

Bye, Olaf.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 33648559
Thanks Olaf!

It's working now...earlier I was using this:

Form..
   
  AddObject as TTree

Define Class TTree As OleControl
   proc init
     LOCAL lnRet, lnHwnd
     lnHwnd = THISFORM.yourTreeView.hWnd
     lnRet = SetWindowLong(lnHwnd,GWL_STYLE, BITOR     (TVS_NOTOOLTIPS,GetWindowLong(lnHwnd,GWL_STYLE)))
endproc
enddefine

it didn't work!!!

but it's working if I use:

Form..
   
  AddObject as OcleControl

  proc init
     LOCAL lnRet, lnHwnd
     lnHwnd = THISFORM.yourTreeView.hWnd
     lnRet = SetWindowLong(lnHwnd,GWL_STYLE, BITOR     (TVS_NOTOOLTIPS,GetWindowLong(lnHwnd,GWL_STYLE)))
endproc

the question is why it didn't work when I defined a class outside the Form Define?

Thanks!
SP
 
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 33648861
yourTreeview does not work as long as the name is otherwise. I don't see your code defining a treeview in either way, your class definition is an olecontrol, your AddObject as Olecontrol also does not explicitly add a treeview.

The foxpro base class Olecontrol rather is an empty container for any ole control, no more, no less. Only as you choose what type of olecontrol it get's that olecontrol. Only after that there is a hwnd property you can read.

Bye, Olaf.
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 33649122
Well, I tried to put everything as shortcut.

Define MyForm As Form
    Add Object MyTree as TTree
Enddefine

Define Class TTree As OleControl
   procedure init
     LOCAL lnRet, lnHwnd
     lnHwnd = THISFORM.TTree.hWnd
     lnRet = SetWindowLong(lnHwnd,GWL_STYLE, BITOR     (TVS_NOTOOLTIPS,GetWindowLong(lnHwnd,GWL_STYLE)))
   endproc

The question is: Why VF says "TTree" is not evaluted to an object?

If I use this inside Form Init it doesn't.

Thanks!
SP
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 33649999
Because you name your object MyTree in the form in the Add Object clause, TTree is the class name, MyTree is the object name.

Bye, Olaf.
0
 
LVL 30

Accepted Solution

by:
Olaf Doschke earned 1800 total points
ID: 33650035
The general problem is, you define your class with code that only works, if you instanciate the class with a certain name, that is you're making the class dependant on the environment. Such code should be self referential, eg you say THIS, not THISFORM.objectname in the init of a class definition and then that works anywhere.

The sample of the wiki was rather for the form.init(), not for the treeview init.

So afterall the better class definition would be:


#DEFINE...
...

Define Class TTree As OleControl
   procedure init
     LOCAL lnRet, lnHwnd
     lnHwnd = THIS.hWnd
     lnRet = SetWindowLong(lnHwnd,GWL_STYLE, BITOR (TVS_NOTOOLTIPS,GetWindowLong(lnHwnd,GWL_STYLE)))
   endproc

...
EndDefine

Open in new window

0
 
LVL 35

Author Closing Comment

by:Nirmal Sharma
ID: 33651255
Thanks Olaf for the solution!
Thanks Pcelba for the response!

SP
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question