-
Jun 22nd, 2007, 09:04 PM
#41
New Member
Re: Create Custom ToolTips using API
Hello,
I need your help on using the tooltip, for a Combo. In the sense when the Mouse moves over each of the ListItems in the Combo, a respective TootTip must trigger.
Say A,B,C are the listItems, then on mouseOver, a respective Tooltip needs to be displayed.
I guess as the Combo does not have a MouseOver event, will it be possible to establish this using some APIs.
Can you tell me on how to do this?
Thanks & Regards
Ramasubramanian Radhakkrishnan
-
Jun 23rd, 2007, 08:38 AM
#42
Re: Create Custom ToolTips using API
You need to subclass the combo and then trap for the event that if fired when moving the mouse over the items. I am afraid I don't know what the exact windows msg is that you would have to handle.
If you look in the tooltips project there is a module called modMsgHook. This is used to subclass the tooptip window. This can also be used to subclass the combo box.
You can only set opne tooltip for each control, so once you handle the moveover event you need to change the entire tooltip for the combo. An example of this is shown in the demo app using the listview control...as the mouse moves over each listitem the listviews tooltip gets changed.
Hope this helps.
Woka
-
Jun 29th, 2007, 10:24 PM
#43
Re: Create Custom ToolTips using API
Just a thought, but any chance of adding code for clickable links in the tooltip?
-
Jun 30th, 2007, 03:33 AM
#44
Re: Create Custom ToolTips using API
That is perfectly possibe, however, I have not developed in VB6 for 2-3 years now and I have stopped maintaining and adding features to my VB6 source codes.
Feel free to give it a go yourself.
Woka
-
Sep 20th, 2007, 02:11 PM
#45
Hyperactive Member
Re: Create Custom ToolTips using API
Hi,
I am using your code in my software and it is working 100% fine. But I would be really grateful if it will be applicable on the following conditions:
Is is possible to show tooltips on controls (having .text property) without mouse intervention. If I come straight to the point, can the tips be shown on control_change() event or control_gotfocus() event.
-
Sep 23rd, 2007, 10:10 AM
#46
Re: Create Custom ToolTips using API
Yes. Just trap the msg in the message handler class and call the draw tooltip function.
Woka
-
Sep 25th, 2007, 06:09 AM
#47
Hyperactive Member
Re: Create Custom ToolTips using API
Originally Posted by Wokawidget
Yes. Just trap the msg in the message handler class and call the draw tooltip function.
Woka
Could you just show me how to handle the events cos' I have no idea. It would be thankful if you show both ways:
1. TextBox_Change()
2. TextBox_GotFocus()
-
Dec 4th, 2007, 04:57 AM
#48
Hyperactive Member
Re: Create Custom ToolTips using API
Originally Posted by Wokawidget
ths is because it uses the control name for a key, and the control name is the same for all controls in an array. U need to modify the code to change the key it's saving in the collection when adding a tooltip to a control.
Woka
Hi Woka ,
Thanks your work of this, Can you guide me how to save the control array to the collection ?
Thanks woka :-)
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Dec 5th, 2007, 07:58 AM
#49
Re: Create Custom ToolTips using API
I dont have a machine with VB6 on it I am afraid, so can't test this.
But in the function that adds the control to the collection it uses the controls name as the key.
You need to modify that 1 line of code so that it:
a) Tests if the control is part of an arry
b) If so then get index of control and add that to the control name to get your unique key
c) You need to modify the code where it gets the control tooltip from the array in the same manner. it needs the index adding to the name.
Woka
-
Dec 5th, 2007, 07:24 PM
#50
Hyperactive Member
Re: Create Custom ToolTips using API
Thanks woka,
I will try your suggested method..
NuFLaVoRs
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Jan 25th, 2008, 05:53 PM
#51
New Member
Re: Create Custom ToolTips using API
Anyone know how to get the tooltip to work with a LABEL. It seems to work with most other controls...
-
Jan 25th, 2008, 07:50 PM
#52
Re: Create Custom ToolTips using API
This is because the code requires the control to have a handle, hWnd, which a label simply does not have.
You will need to create your own label usercontrol that has a hWnd property. This is simply a limitation of a VB6 label, nothing really you can do about it.
Do a search on google for this code.
Woka
-
Mar 26th, 2008, 07:38 AM
#53
Fanatic Member
Re: Create Custom ToolTips using API
Anyone know how to only bold a part of the text you want in the tooltip and not all of it?
-
Mar 27th, 2008, 07:11 AM
#54
Lively Member
Re: Create Custom ToolTips using API
I have tried this tooltip out and it works great. However, I ran into a problem if the tooltip is set on a button and the button launches a form. The tooltip doesn't appear for that button anymore.
In the "Stage 10" code, if you add an empty form and paste this code into one of the buttons click events:
Code:
Dim f As Form1
Set f = New Form1
f.Show vbModal
Set f = Nothing
If you hover over the button before clicking, the tip shows up. After clicking and dismissing the form it doesn't show up any more. Any ideas?
Thanks...
-
Mar 30th, 2008, 01:44 PM
#55
Re: Create Custom ToolTips using API
Originally Posted by drag0n_45
Anyone know how to only bold a part of the text you want in the tooltip and not all of it?
This would be a lot more complex to handle...off the top of my head you could pass in text like: "This is <b>MY</b> tooltip", and then in the code that writes the message you would have to validate your text and write different bits out with different formatting.
The code does not handle this natively as it stands now.
Woka
-
Mar 30th, 2008, 01:47 PM
#56
Re: Create Custom ToolTips using API
Originally Posted by fenrisW0lf
I have tried this tooltip out and it works great. However, I ran into a problem if the tooltip is set on a button and the button launches a form. The tooltip doesn't appear for that button anymore.
In the "Stage 10" code, if you add an empty form and paste this code into one of the buttons click events:
Code:
Dim f As Form1
Set f = New Form1
f.Show vbModal
Set f = Nothing
If you hover over the button before clicking, the tip shows up. After clicking and dismissing the form it doesn't show up any more. Any ideas?
Thanks...
This is because you used vbModal.
This locks the Form1 as the top most form in a windows app. The form below it does not receive mouse events.
I do not have VB6 installed on this PC anymore, but from what I can remember even a normal default vb6 tooltip would fail on this.
Woka
Try using vbModeless instead.
-
Aug 25th, 2009, 08:53 AM
#57
New Member
Re: Create Custom ToolTips using API
I found this thread very helpful and the code supplied here works perfectly, except one thing... From version 2 it doesn't work with non-English text... I try to print something in Greek and it doesn't work... Only the first version displays Greek correctly...
Anyone has an idea?
PS I know this is a very old thread and i probably won't get an answer...
-
Feb 18th, 2016, 05:13 PM
#58
Lively Member
Re: Create Custom ToolTips using API
this is good but does not support labels, has anyone modified it or knows of one similar that does labels as well
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|