Private _toolbar As GrapeCity.Windows.SpreadSheet.UI.TouchToolbar
Public Sub New()
InitializeComponent()
Me.InitializeTouchStrip()
End Sub
Private Sub GcSpreadSheet1_TouchToolbarOpening(sender As Object, e As GrapeCity.Windows.SpreadSheet.UI.TouchToolbarOpeningEventArgs) Handles GcSpreadSheet1.TouchToolbarOpening
e.Handled = True
_toolbar.Show(e.X - 100, e.Y - 100)
End Sub
Private Sub autoFill_Click(sender As Object, e As EventArgs)
Dim activeView = Me.GcSpreadSheet1.View
If activeView IsNot Nothing Then
activeView.ShowAutoFillIndicator()
End If
End Sub
Private Sub InitializeTouchStrip()
_toolbar = GrapeCity.Windows.SpreadSheet.UI.TouchToolbarFactory.CreateCutCopyPasteToolBar(Me.GcSpreadSheet1.View)
For Each item In _toolbar.ToolbarItems
Dim toolbarButton = TryCast(item, GrapeCity.Windows.SpreadSheet.UI.ToolbarButton)
If toolbarButton IsNot Nothing AndAlso toolbarButton.Title = "Cut" Then
toolbarButton.Visibility = System.Windows.Visibility.Collapsed
Exit For
End If
Next
Dim separator1 = New GrapeCity.Windows.SpreadSheet.UI.ToolbarSeparator()
_toolbar.ToolbarItems.Add(separator1)
Dim autoFillButton = GrapeCity.Windows.SpreadSheet.UI.TouchToolbarFactory.CreateDragFillButton()
_toolbar.ToolbarItems.Add(autoFillButton)
Dim separator2 = New GrapeCity.Windows.SpreadSheet.UI.ToolbarSeparator()
_toolbar.ToolbarItems.Add(separator2)
Dim grid__1 = New Grid()
grid__1.RowDefinitions.Add(New RowDefinition())
grid__1.RowDefinitions.Add(New RowDefinition())
Dim row1 = New StackPanel() With { _
.Orientation = Orientation.Horizontal _
}
Dim row2 = New StackPanel() With { _
.Orientation = Orientation.Horizontal _
}
Grid.SetRow(row1, 0)
Grid.SetRow(row2, 1)
grid__1.Children.Add(row1)
grid__1.Children.Add(row2)
Dim uri As New Uri("C:\info.png", UriKind.Absolute)
Dim img As New BitmapImage(uri)
row1.Children.Add(New GrapeCity.Windows.SpreadSheet.UI.ToolbarButton(Nothing, img))
row1.Children.Add(New GrapeCity.Windows.SpreadSheet.UI.ToolbarButton(Nothing, img))
row2.Children.Add(New GrapeCity.Windows.SpreadSheet.UI.ToolbarButton(Nothing, img))
row2.Children.Add(New GrapeCity.Windows.SpreadSheet.UI.ToolbarButton(Nothing, img))
_toolbar.ToolbarItems.Add(grid__1)
Dim separator3 = New GrapeCity.Windows.SpreadSheet.UI.ToolbarSeparator()
_toolbar.ToolbarItems.Add(separator3)
Dim toolbarDropdown = New GrapeCity.Windows.SpreadSheet.UI.ToolbarDropDown()
Dim menu = New GrapeCity.Windows.SpreadSheet.UI.ContextMenu()
menu.Items.Add("Item1")
toolbarDropdown.Menu = menu
_toolbar.ToolbarItems.Add(toolbarDropdown)
End Sub