This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.vb
51 lines (46 loc) · 1.55 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
40
41
42
43
44
45
46
47
48
49
50
51
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Namespace WindowsApplication26
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private autoScrollHelper As AutoScrollHelper
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
gridControl1.DataSource = GetDataTable()
layoutView1.OptionsView.ViewMode = DevExpress.XtraGrid.Views.Layout.LayoutViewMode.Column
autoScrollHelper = New AutoScrollHelper(layoutView1)
End Sub
Private Function GetDataTable() As DataTable
Const ColCount As Integer = 3
Const RowCount As Integer = 100
Dim table As New DataTable()
For i As Integer = 0 To ColCount - 1
table.Columns.Add()
Next i
For j As Integer = 0 To RowCount - 1
Dim row As DataRow = table.NewRow()
For i As Integer = 0 To ColCount - 1
row(i) = String.Format("row {0} / col {1}", j, i)
Next i
table.Rows.Add(row)
Next j
table.AcceptChanges()
Return table
End Function
Private Sub simpleButton1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles simpleButton1.MouseMove
simpleButton1.DoDragDrop("test", DragDropEffects.Move)
End Sub
Private Sub gridControl1_DragOver(ByVal sender As Object, ByVal e As DragEventArgs) Handles gridControl1.DragOver
e.Effect = DragDropEffects.Move
autoScrollHelper.ScrollIfNeeded()
End Sub
End Class
End Namespace