using System;
using System.Windows.Forms;
namespace GrapeCity.Win.MultiRow.SampleCode
{
class ScrollDemo : Form
{
GcMultiRow gcMultiRow = new GcMultiRow();
public ScrollDemo()
{
this.Text = "Scroll Tip Demo";
gcMultiRow.Dock = DockStyle.Fill;
gcMultiRow.ShowScrollTip = ScrollBars.Both;
gcMultiRow.Template = Template.CreateGridTemplate(10);
gcMultiRow.HorizontalScrollTipAlignment = HorizontalScrollTipAlignment.Right;
gcMultiRow.VerticalScrollTipAlignment = VerticalScrollTipAlignment.Bottom;
gcMultiRow.RowCount = 100;
this.gcMultiRow.ScrollTipTextNeeded += new EventHandler<ScrollTipTextNeededEventArgs>(gcMultiRow_ScrollTipTextNeeded);
this.Controls.Add(gcMultiRow);
}
void gcMultiRow_ScrollTipTextNeeded(object sender, ScrollTipTextNeededEventArgs e)
{
if (e.Direction == Orientation.Horizontal)
{
e.ScrollTipText = "Scroll to " + e.ScrollBarValue.ToString() + " pixel";
}
else
{
e.ScrollTipText = "Scroll to " + e.ScrollRowIndex.ToString() + " row";
}
}
[STAThreadAttribute()]
public static void Main()
{
Application.EnableVisualStyles();
Application.Run(new ScrollDemo());
}
}
}
Imports System
Imports System.Windows.Forms
Imports GrapeCity.Win.MultiRow
Class ScrollDemo
Inherits Form
Friend WithEvents gcMultiRow As New GcMultiRow()
Public Sub New()
Me.Text = "Scroll Tip Demo"
gcMultiRow.Dock = DockStyle.Fill
gcMultiRow.ShowScrollTip = ScrollBars.Both
gcMultiRow.HorizontalScrollTipAlignment = HorizontalScrollTipAlignment.Right
gcMultiRow.VerticalScrollTipAlignment = VerticalScrollTipAlignment.Bottom
gcMultiRow.Template = Template.CreateGridTemplate(10)
gcMultiRow.RowCount = 100
Me.Controls.Add(gcMultiRow)
End Sub
Private Sub gcMultiRow_ScrollTipTextNeeded(ByVal sender As Object, ByVal e As ScrollTipTextNeededEventArgs) Handles gcMultiRow.ScrollTipTextNeeded
If e.Direction = Orientation.Horizontal Then
e.ScrollTipText = "Scroll to " + e.ScrollBarValue.ToString() + " pixel"
Else
e.ScrollTipText = "Scroll to " + e.ScrollRowIndex.ToString() + " row"
End If
End Sub
<STAThreadAttribute()> _
Public Shared Sub Main()
Application.EnableVisualStyles()
Application.Run(New ScrollDemo())
End Sub
End Class