Custom Tooltips??? |
Post Reply |
Author | |
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
Posted: 14 December 2007 at 4:51am |
Hi,
Is there any way that the CalendarControl tooltips can be customed to have the Office2007 theme and adjust the tooltip width?
P.S. I hope I get a response to this, even if it's a no it can't be done!!!
|
|
cjprb
Newbie Joined: 08 June 2007 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
I dont think you can atm.
I would also like that to be added to the next version.
Claus
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
No, with those tooltips its not possible.
However, as a workaround you can disable regular tooltips, catch events like MouseMove and using HitTest set required text to any kind of custom Tooltips components. -- WBR, Serge |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Yeah I thought as much... thanks for the confirmation that it can't be done by the control itself. Managed to workaround it with the Mousemove and HitTest.
|
|
shady14u
Newbie Joined: 07 May 2007 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
|
I am looking to do this same exact thing... do you have an example or can you explain how you did this to make the custom tool tips with gradients and extra width? Thanks in advance
|
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Put a label on your desktop i.e. lblTooltip and make it invisible. Put a timer on the desktop i.e. tmrTooltip and set it to enabled = False and Interval 1000 (1 second)
The following code should get you a tooltip that appears 1 second after you scroll over an Event in the Calendar control. I wanted a delay before the tooltip appeared.
Private Sub CalendarControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 0 Then Dim HitTest As CalendarHitTestInfo Set HitTest = CalendarControl.ActiveView.HitTest CalendarControl.EnableToolTips False If Not HitTest.ViewEvent Is Nothing Then ' Set the caption of the Tooltip Label
lblTooltip.Caption = Replace(HitTest.ViewEvent.Event.Subject & vbCrLf & HitTest.ViewEvent.Event.Body, "&", "&&") ' Check to see if the Tooltip goes beyond the Screen width
If X + lblTooltip.Width > Screen.Width Then X = Screen.Width - lblTooltip.Width End If ' Position the Tooltip lblTooltip.Move X, Y + 1300 ' Start the Timer for the Tooltip If lblTooltip.Visible <> True Then tmrTooltip.Enabled = True End If Else
' Hide the Tooltip tmrTooltip.Enabled = False lblTooltip.Visible = False End If Else
' Hide the Tooltip
tmrTooltip.Enabled = False lblTooltip.Visible = False End If End Sub
Private Sub tmrTooltip_Timer()
' Display the Tooltip & stop the Timer
lblTooltip.Visible = True tmrTooltip.Enabled = False End Sub You may need to add additional code depending on how you use this in your app.
|
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Oh, I got the gradient by using a label control that has the ability to create the gradient within itself by giving the starting and finishing colours.
If you don't have that, then you could simply use a picturebox... and apply a gradient fill to it.
|
|
shady14u
Newbie Joined: 07 May 2007 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Worked great thank you very much!!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |