Improve company productivity with a Business Account.Sign Up

x
?
Solved

ToolTip and TreeView

Posted on 2010-09-10
9
Medium Priority
?
530 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 44

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 31

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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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 31

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 31

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 31

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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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…
Importing Outlook PST contacts to Exchange Server can become a complicated task. Situations arise where an Exchange user is not able to import contacts from PST to Exchange Mailboxes in an efficient manner. Try SysTools Exchange Import to move conta…
Watch the video which demonstrates the easy migration process from GroupWise to Outlook with the help of Kernel Novell GroupWise to Outlook software. User can export single or multiple mailboxes either by Online mode or via Command line mode with ea…
Go through the video which explain the procedure to export Amazon WorkMail single or multiple mailboxes to Outlook with Kernel Export Amazon WorkMail to PST tool. User can see the simple steps to export. It has salient features like filters (Include…

580 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