Skip to content

Commit 759300d

Browse files
DevExpressExampleBotDevExpressExampleBot
authored andcommitted
Source auto update [skip ci]
1 parent 54ab56d commit 759300d

File tree

11 files changed

+248
-273
lines changed

11 files changed

+248
-273
lines changed

VB/WindowsApplication1/Form1.Designer.vb

Lines changed: 63 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VB/WindowsApplication1/Form1.vb

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,57 @@
1-
Imports Microsoft.VisualBasic
21
Imports System
3-
Imports System.Collections.Generic
42
Imports System.ComponentModel
5-
Imports System.Data
63
Imports System.Drawing
7-
Imports System.Text
84
Imports System.Windows.Forms
95
Imports DevExpress.XtraGrid.Views.Grid
106

117
Namespace WindowsApplication1
12-
Partial Public Class Form1
13-
Inherits Form
14-
Public Sub New()
15-
InitializeComponent()
16-
End Sub
17-
18-
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
19-
Dim TempXViewsPrinting As DevExpress.XtraGrid.Design.XViewsPrinting = New DevExpress.XtraGrid.Design.XViewsPrinting(gridControl1)
20-
gridView1.OptionsSelection.MultiSelect = True
21-
gridView1.OptionsBehavior.Editable = False
22-
gridView1.OptionsSelection.EnableAppearanceFocusedCell = False
23-
End Sub
24-
25-
Private Sub SelectRows(ByVal view As GridView, ByVal startRow As Integer, ByVal endRow As Integer)
26-
If startRow > -1 AndAlso endRow > -1 Then
27-
view.BeginSelection()
28-
view.ClearSelection()
29-
view.SelectRange(startRow, endRow)
30-
view.EndSelection()
31-
End If
32-
End Sub
33-
34-
Private Function GetRowAt(ByVal view As GridView, ByVal x As Integer, ByVal y As Integer) As Integer
35-
Return view.CalcHitInfo(New Point(x, y)).RowHandle
36-
End Function
37-
38-
Private StartRowHandle As Integer = -1
39-
Private CurrentRowHandle As Integer = -1
40-
41-
Private Sub gridView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gridView1.MouseDown
42-
StartRowHandle = GetRowAt(TryCast(sender, GridView), e.X, e.Y)
43-
End Sub
44-
45-
Private Sub gridView1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gridView1.MouseMove
46-
Dim newRowHandle As Integer = GetRowAt(TryCast(sender, GridView), e.X, e.Y)
47-
If CurrentRowHandle <> newRowHandle Then
48-
CurrentRowHandle = newRowHandle
49-
SelectRows(TryCast(sender, GridView), StartRowHandle, CurrentRowHandle)
50-
End If
51-
End Sub
52-
53-
Private Sub gridView1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gridView1.MouseUp
54-
StartRowHandle = -1
55-
CurrentRowHandle = -1
56-
End Sub
57-
End Class
58-
End Namespace
8+
9+
Public Partial Class Form1
10+
Inherits Form
11+
12+
Public Sub New()
13+
InitializeComponent()
14+
End Sub
15+
16+
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
17+
Dim tmp_XViewsPrinting = New DevExpress.XtraGrid.Design.XViewsPrinting(gridControl1)
18+
gridView1.OptionsSelection.MultiSelect = True
19+
gridView1.OptionsBehavior.Editable = False
20+
gridView1.OptionsSelection.EnableAppearanceFocusedCell = False
21+
End Sub
22+
23+
Private Sub SelectRows(ByVal view As GridView, ByVal startRow As Integer, ByVal endRow As Integer)
24+
If startRow > -1 AndAlso endRow > -1 Then
25+
view.BeginSelection()
26+
view.ClearSelection()
27+
view.SelectRange(startRow, endRow)
28+
view.EndSelection()
29+
End If
30+
End Sub
31+
32+
Private Function GetRowAt(ByVal view As GridView, ByVal x As Integer, ByVal y As Integer) As Integer
33+
Return view.CalcHitInfo(New Point(x, y)).RowHandle
34+
End Function
35+
36+
Private StartRowHandle As Integer = -1
37+
38+
Private CurrentRowHandle As Integer = -1
39+
40+
Private Sub gridView1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
41+
StartRowHandle = GetRowAt(TryCast(sender, GridView), e.X, e.Y)
42+
End Sub
43+
44+
Private Sub gridView1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
45+
Dim newRowHandle As Integer = GetRowAt(TryCast(sender, GridView), e.X, e.Y)
46+
If CurrentRowHandle <> newRowHandle Then
47+
CurrentRowHandle = newRowHandle
48+
SelectRows(TryCast(sender, GridView), StartRowHandle, CurrentRowHandle)
49+
End If
50+
End Sub
51+
52+
Private Sub gridView1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)
53+
StartRowHandle = -1
54+
CurrentRowHandle = -1
55+
End Sub
56+
End Class
57+
End Namespace

VB/WindowsApplication1/My Project/Resources.Designer.vb

Lines changed: 0 additions & 63 deletions
This file was deleted.

VB/WindowsApplication1/My Project/Settings.Designer.vb

Lines changed: 0 additions & 29 deletions
This file was deleted.

VB/WindowsApplication1/Program.vb

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
Imports Microsoft.VisualBasic
21
Imports System
3-
Imports System.Collections.Generic
42
Imports System.Windows.Forms
53

64
Namespace WindowsApplication1
7-
Friend NotInheritable Class Program
8-
''' <summary>
9-
''' The main entry point for the application.
10-
''' </summary>
11-
Private Sub New()
12-
End Sub
13-
<STAThread> _
14-
Shared Sub Main()
15-
Application.EnableVisualStyles()
16-
Application.SetCompatibleTextRenderingDefault(False)
17-
Application.Run(New Form1())
18-
End Sub
19-
End Class
20-
End Namespace
5+
6+
Friend Module Program
7+
8+
''' <summary>
9+
''' The main entry point for the application.
10+
''' </summary>
11+
<STAThread>
12+
Sub Main()
13+
Call Application.EnableVisualStyles()
14+
Application.SetCompatibleTextRenderingDefault(False)
15+
Call Application.Run(New Form1())
16+
End Sub
17+
End Module
18+
End Namespace

0 commit comments

Comments
 (0)