Print Page | Close Window

Custom Tooltips???

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=9102
Printed Date: 30 November 2024 at 11:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom Tooltips???
Posted By: Xander75
Subject: Custom Tooltips???
Date 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!!!
 



Replies:
Posted By: cjprb
Date Posted: 18 December 2007 at 7:53am
I dont think you can atm.
 
I would also like that to be added to the next version.
 
Claus


Posted By: sserge
Date Posted: 19 December 2007 at 5:45pm
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


Posted By: Xander75
Date Posted: 20 December 2007 at 4:33am

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.
 



Posted By: shady14u
Date Posted: 20 December 2007 at 9:04am

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


Posted By: Xander75
Date Posted: 20 December 2007 at 11:34am

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.


Posted By: Xander75
Date Posted: 20 December 2007 at 11:37am
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.


Posted By: shady14u
Date Posted: 20 December 2007 at 1:41pm
Worked great thank you very much!!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net