-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.vb
39 lines (34 loc) · 1.61 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Imports System
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Namespace CustomButton
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
' load some demo data
Dim tmp_XViewsPrinting = New DevExpress.XtraGrid.Design.XViewsPrinting(gridControl1)
gridView1.OptionsSelection.MultiSelect = True
gridControl1.UseEmbeddedNavigator = True
AddHandler gridControl1.EmbeddedNavigator.ButtonClick, New DevExpress.XtraEditors.NavigatorButtonClickEventHandler(AddressOf gridControl1_EmbeddedNavigator_ButtonClick)
gridControl1.EmbeddedNavigator.Buttons.ImageList = imageCollection1
Dim button As DevExpress.XtraEditors.NavigatorCustomButton
button = gridControl1.EmbeddedNavigator.Buttons.CustomButtons.Add()
button.Tag = "copy"
button.Hint = "Copy to clipboard"
button.ImageIndex = 0
End Sub
Private Sub gridControl1_EmbeddedNavigator_ButtonClick(ByVal sender As Object, ByVal e As DevExpress.XtraEditors.NavigatorButtonClickEventArgs)
If "copy".Equals(e.Button.Tag) Then
If gridControl1.FocusedView IsNot Nothing Then
gridControl1.FocusedView.CopyToClipboard()
MessageBox.Show("Selected data has been copied to the Clipboard")
e.Handled = True
End If
End If
End Sub
End Class
End Namespace