You are not logged in.
This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.
Hello
I want change name of sheet tab after click of mouse,
but how intercept the click of mouse into tab name of worksheet???
I use vb .net 2015 with WPF
Dim GridCalco As New ReoGridControl()
With GridCalco
.Margin = New Thickness(10, 100, 10, 10)
.Worksheets.Clear()
'.sh
AddHandler GridCalco.MouseDown, AddressOf GridMouseDown
AddHandler GridCalco.MouseRightButtonDown, AddressOf GridMouseRightDown
AddHandler GridCalco.WorksheetInserted, AddressOf WorkSheetInsert
AddHandler GridCalco.MouseLeftButtonDown, AddressOf GridMouseLeftDown
End With
Private Sub GridMouseLeftDown(sender As Object, e As EventArgs)
???? how intercept click into tab sheet name????
End Sub
Offline
You can use Worksheet.CellMouseDown event to get mouse click event and use Worksheet.Name property to change the sheet name. Below code applies to all worksheets.
VB.NET:
For Each sheet In GridCalco.Worksheets
AddHandler sheet.CellMouseDown, Sub(_s As Object, _e As EventArgs)
Dim newName = InputBox("Please enter sheet name: ", "Rename", sheet.Name)
If Not String.IsNullOrEmpty(newName) Then sheet.Name = newName
End Sub
Next
Also: Don't use Worksheets.Clear method since it may makes exception happen if there is no worksheet included in a workbook.
Last edited by Jingwood (2016-02-04 11:38:15)
Offline