Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic MonthRange/Single Month tooltips (Read 2932 times)
BenWTS
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Jun 19th, 2008
MonthRange/Single Month tooltips
Aug 13th, 2008 at 4:27pm
Print Post  
Is there a way to get tooltips when hovering over dates in the MonthRange or SingleMonth view?

We'd like to display some information on how many appointments or how much free time is available on dates in the tooltip for that date.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: MonthRange/Single Month tooltips
Reply #1 - Aug 14th, 2008 at 7:17am
Print Post  
You have to set ShowToolTips property of the Calendar object to true. Then, optionally, you can handle the TooltipDisplaying event in order to customize the displayed tooltip, according to the date cell it is being displayed for.

Meppy
  
Back to top
 
IP Logged
 
BenWTS
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Jun 19th, 2008
Re: MonthRange/Single Month tooltips
Reply #2 - Aug 14th, 2008 at 1:28pm
Print Post  
I'm missing something then. Here is some simple code, I set the ShowToolTips to true but I don't get any tooltips when hovering over a date.

Form1.cs:
namespace ToolTipTest
{
    public partial class Form1 : Form
    {
       public Form1()
       {
           InitializeComponent();
       }
    }
}

Form1.Designer.cs
namespace ToolTipTest
{
    partial class Form1
    {
       /// <summary>
       /// Required designer variable.
       /// </summary>
       private System.ComponentModel.IContainer components = null;

       /// <summary>
       /// Clean up any resources being used.
       /// </summary>
       /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
       protected override void Dispose(bool disposing)
       {
           if (disposing && (components != null))
           {
               components.Dispose();
           }
           base.Dispose(disposing);
       }

       #region Windows Form Designer generated code

       /// <summary>
       /// Required method for Designer support - do not modify
       /// the contents of this method with the code editor.
       /// </summary>
       private void InitializeComponent()
       {
           System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
           this.mfMonthRange = new MindFusion.Scheduling.WinForms.Calendar();
           ((System.ComponentModel.ISupportInitialize)(this.mfMonthRange)).BeginInit();
           this.SuspendLayout();
           //
           // mfMonthRange
           //
           this.mfMonthRange.CurrentTime = new System.DateTime(2008, 4, 13, 0, 0, 0, 0);
           this.mfMonthRange.CurrentView = MindFusion.Scheduling.WinForms.CalendarView.MonthRange;
           this.mfMonthRange.Date = new System.DateTime(2008, 4, 17, 0, 0, 0, 0);
           this.mfMonthRange.DateTimeFormat = ((System.Globalization.DateTimeFormatInfo)(resources.GetObject("mfMonthRange.Dat
eTimeFormat")));
           this.mfMonthRange.Dock = System.Windows.Forms.DockStyle.Fill;
           this.mfMonthRange.EndDate = new System.DateTime(2008, 8, 27, 0, 0, 0, 0);
           this.mfMonthRange.Location = new System.Drawing.Point(0, 0);
           this.mfMonthRange.MonthRangeSettings.MonthsPerRow = 1;
           this.mfMonthRange.MonthRangeSettings.NumberOfMonths = 1;
           this.mfMonthRange.MonthRangeSettings.ScrollInterval = 1;
           this.mfMonthRange.MonthRangeSettings.VisibleRows = 1;
           this.mfMonthRange.Name = "mfMonthRange";
           this.mfMonthRange.ShowToolTips = true;
           this.mfMonthRange.Size = new System.Drawing.Size(292, 266);
           this.mfMonthRange.TabIndex = 4;
           this.mfMonthRange.Theme = MindFusion.Scheduling.WinForms.ThemeType.Windows2003;
           //
           // Form1
           //
           this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
           this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
           this.ClientSize = new System.Drawing.Size(292, 266);
           this.Controls.Add(this.mfMonthRange);
           this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
           this.Name = "Form1";
           this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
           this.Text = "ToolTipTest";
           ((System.ComponentModel.ISupportInitialize)(this.mfMonthRange)).EndInit();
           this.ResumeLayout(false);

       }

       #endregion

       private MindFusion.Scheduling.WinForms.Calendar mfMonthRange;
    }
}
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: MonthRange/Single Month tooltips
Reply #3 - Aug 14th, 2008 at 2:26pm
Print Post  
It appears that the default value of the tooltip text is an empty string, which does not make the tooltip appear. In order to display a text in the tooltip you will have to handle the TooltipDisplaying event of the Calendar class and set the appropriate text to the Tooltip property of the accompanying event argument.

I checked the documentation about the the ShowToolTips property and found it is incomplete. We'll try to update it for the next release as well as provide some default values for the tooltips to prevent the need to handle the above event.

Meppy
  
Back to top
 
IP Logged
 
BenWTS
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Jun 19th, 2008
Re: MonthRange/Single Month tooltips
Reply #4 - Aug 14th, 2008 at 2:48pm
Print Post  
Thanks again, that worked.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint