Solved

ToolTip and TreeView

Posted on 2010-09-10
9
471 Views
Last Modified: 2012-05-10
Hi,

Is there any way to hide the ToolTips for TreeView?

Thanks!
SP
0
Comment
Question by:Nick Sui
  • 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:Nick Sui
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:Nick Sui
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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:Nick Sui
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:Nick Sui
ID: 33651255
Thanks Olaf for the solution!
Thanks Pcelba for the response!

SP
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Convert Word Doc or PDF file to VFP FRX report 9 1,776
dedupe in foxpro 12 439
Book on Fox Pro 9.0 for windows 6 74
FoxPro comparing columns 2 25
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…
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

17 Experts available now in Live!

Get 1:1 Help Now