Solved

ToolTip and TreeView

Posted on 2010-09-10
9
479 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
  • 4
  • 4
9 Comments
 
LVL 41

Assisted Solution

by:pcelba
pcelba earned 50 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 29

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
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 29

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 29

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 29

Accepted Solution

by:
Olaf Doschke earned 450 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now