svnno****@sourc*****
svnno****@sourc*****
2010年 11月 1日 (月) 03:22:46 JST
Revision: 1013 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1013 Author: anis774 Date: 2010-11-01 03:22:45 +0900 (Mon, 01 Nov 2010) Log Message: ----------- APIゲージのツールチップのテキストを修正 Modified Paths: -------------- trunk/Tween/ToolStripAPIGauge.vb -------------- next part -------------- Modified: trunk/Tween/ToolStripAPIGauge.vb =================================================================== --- trunk/Tween/ToolStripAPIGauge.vb 2010-10-31 15:42:42 UTC (rev 1012) +++ trunk/Tween/ToolStripAPIGauge.vb 2010-10-31 18:22:45 UTC (rev 1013) @@ -59,11 +59,7 @@ Set(ByVal value As DateTime) Me._resetTime = value If Not Me.Control.IsDisposed Then - If Me._resetTime >= DateTime.Now Then - Me.ToolTipText = "ResetTime " + Me._resetTime.ToString() - Else - Me.ToolTipText = "ResetTime ???" - End If + Me.SetText(Me._remainCount, Me._maxCount) Me.Control.Refresh() End If End Set @@ -103,6 +99,9 @@ Private Sub SetText(ByVal remain As Integer, ByVal max As Integer) Dim textFormat As String = "API {0}/{1}" + Dim toolTipTextFormat As String = _ + "API rest {0}/{1}" + Environment.NewLine + _ + "(reset after {2} minutes)" If Me._remainCount > -1 AndAlso Me._maxCount > -1 Then ' 正常 @@ -117,5 +116,15 @@ ' 両方とも不正 Me.Control.Text = String.Format(textFormat, "???", "???") End If + + Dim minute As Double = Math.Ceiling((Me.ResetTime - DateTime.Now).TotalMinutes) + Dim minuteText As String + If minute >= 0 Then + minuteText = minute.ToString() + Else + minuteText = "???" + End If + + Me.ToolTipText = String.Format(toolTipTextFormat, Me._remainCount, Me._maxCount, minuteText) End Sub End Class \ No newline at end of file