''' <summary>
''' 下矢印の動作クラス
''' </summary>
''' <remarks></remarks>
Public Class DownArrowActionDouble ' Actionクラスを継承したサブクラスを作成します
Inherits FarPoint.Win.Spread.Action Public Event FormartRow(ByVal sender As Object, ByVal e As FormatRowEventArgs)
Public Event CheckRow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
Public Event LeaveCellArrow(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.LeaveCellEventArgs) Public Overrides Sub PerformAction(ByVal sender As Object) If TypeOf sender Is FarPoint.Win.Spread.SpreadView Then
' アクティブシートを取得します
Dim spread As FarPoint.Win.Spread.SpreadView = CType(sender, FarPoint.Win.Spread.SpreadView)
Dim sheet As FarPoint.Win.Spread.SheetView = spread.Sheets(spread.ActiveSheetIndex) ' アクティブセルの行列インデックスを取得します
Dim Row As Integer = sheet.ActiveRowIndex
Dim Col As Integer = sheet.ActiveColumnIndex Dim EvenRow As Integer
Dim OddROw As Integer
If Row Mod 2 = 0 Then
EvenRow = Row
OddROw = Row + 1
Else
EvenRow = Row - 1
OddROw = Row
End If ' 移動先のセルの行列インデックス用変数を宣言します
Dim NewRow As Integer
Dim NewColumn As Integer Dim isAddRow As Boolean
isAddRow = (Row = sheet.RowCount - 1 OrElse (Row = sheet.RowCount - 2 And sheet.Cells(Row + 1, Col).Locked = True))
Dim isMoveNext As Boolean
isMoveNext = True Dim e As New System.ComponentModel.CancelEventArgs
If Row = OddROw OrElse (Row = EvenRow And sheet.Cells(Row + 1, Col).Locked = True) Then
RaiseEvent CheckRow(Me, e)
End If
isMoveNext = Not e.Cancel If isAddRow And e.Cancel = False Then
sheet.RowCount = sheet.RowCount + 2
RaiseEvent FormartRow(Me, New FormatRowEventArgs(sheet.RowCount - 2, Col))
End If If isMoveNext Then
NewRow = Row
For i As Integer = Row + 1 To sheet.RowCount - 1
If sheet.Cells(i, Col).Locked = False Then
NewRow = i
Exit For
End If
Next
NewColumn = Col
End If ' 移動先のセルがシート上に存在する場合
If isMoveNext = True And NewRow < sheet.RowCount And NewColumn < sheet.ColumnCount Then
Dim ss1 As FarPoint.Win.Spread.SpreadView = spread.GetRootWorkbook
RaiseEvent LeaveCellArrow(spread, New FarPoint.Win.Spread.LeaveCellEventArgs(ss1, Row, Col, NewRow, NewColumn))
' アクティブセルを設定します
sheet.SetActiveCell(NewRow, NewColumn)
spread.ShowActiveCell(FarPoint.Win.Spread.VerticalPosition.Nearest, FarPoint.Win.Spread.HorizontalPosition.Nearest)
End If
End If
End Sub End Class Public Class CheckRowEventArgs Inherits System.ComponentModel.CancelEventArgs Dim m_IsBlankRow As Boolean
Public Property IsBlankRow() As Boolean
Get
Return m_IsBlankRow
End Get
Set(ByVal value As Boolean)
m_IsBlankRow = value
End Set
End Property End Class Public Class FormatRowEventArgs Inherits EventArgs Public Sub New(ByVal fRow As Integer, ByVal fCol As Integer)
m_FormatRow = fRow
m_FormatCol = fCol
End Sub Dim m_FormatRow As Integer
Public Property FormatRow() As Integer
Get
Return m_FormatRow
End Get
Set(ByVal value As Integer)
m_FormatRow = value
End Set
End Property Dim m_FormatCol As Integer
Public Property FormatCol() As Integer
Get
Return m_FormatCol
End Get
Set(ByVal value As Integer)
m_FormatCol = value
End Set
End Property End Class

  

        ' アクションをマッピングします
Dim am As FarPoint.Win.Spread.ActionMap = ssBody.GetActionMap()
Dim ac As New DownArrowActionDouble()
AddHandler ac.CheckRow, AddressOf FpSpead1_CheckRow
AddHandler ac.FormartRow, AddressOf FpSpead1_FormartRow
AddHandler ac.LeaveCellArrow, AddressOf ssBodyFpSpead1_LeaveCell
am.Put("CustomAction", ac) im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Down, Keys.None), "CustomAction") Private Sub FpSpead1_CheckRow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) End Sub Private Sub FpSpead1_FormartRow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) End Sub Private Sub FpSpead1_LeaveCell(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.LeaveCellEventArgs) End Sub

SPREAD for Windows Forms 下箭头追加行的更多相关文章

  1. SPREAD for Windows Forms 代码片段

    'スクロールバーの移動 FpSpread1.ShowColumn(, , HorizontalPosition.Left) 'SetActiveCellの後.LeaveCellを呼び出す Dim ss ...

  2. SPREAD for Windows Forms 控制输入法

    enc = System.Text.Encoding.GetEncoding("shift-jis") datamodel = CType(FpSpread1.ActiveShee ...

  3. Eclipse中快捷键Ctrl + Alt + 向上箭头 或者 Ctrl + Alt + 向下箭头与Windows冲突

    原文地址:https://blog.csdn.net/buaaroid/article/details/50804608 clipse中按ctrl + alt + 向上箭头没有任何反应,按ctrl + ...

  4. Windows 下的高 DPI 应用开发(UWP / WPF / Windows Forms / Win32)

    本文将介绍 Windows 系统中高 DPI 开发的基础知识.由于涉及到坐标转换,这种转换经常发生在计算的不知不觉中:所以无论你使用哪种 Windows 下的 UI 框架进行开发,你都需要了解这些内容 ...

  5. Windows Forms和WPF在Net Core 3.0框架下并不会支持跨平台

    Windows Forms和WPF在Net Core 3.0框架下并不会支持跨平台 微软将WinForms和WPF带到.NET Core 3.0这一事实,相信大家都有所了解,这是否意味着它在Linux ...

  6. .net chart(图表)控件的使用-System.Windows.Forms.DataVisualization.dll

    这个案例指在介绍微软这套免费又功能强大的图表控件Microsoft Chart Controls for Microsoft .NET Framework 3.5,通过它,可让您的项目及报表,轻松套用 ...

  7. 如何重载ComboBox 使其下拉按钮(带下箭头的)和下拉列表的垂直滚动条的宽度改变?(自绘ComboBox) [转]

    原文地址:http://bbs.csdn.net/topics/390135022 http://blog.csdn.net/scsdn/article/details/4363299 想使用winf ...

  8. Wizard Framework:一个自己开发的基于Windows Forms的向导开发框架

    最近因项目需要,我自己设计开发了一个基于Windows Forms的向导开发框架,目前我已经将其开源,并发布了一个NuGet安装包.比较囧的一件事是,当我发布了NuGet安装包以后,发现原来已经有一个 ...

  9. DotNetBar for Windows Forms 12.9.0.0_冰河之刃重打包版及制作Visual Studio C#项目模板文件详解

    关于 DotNetBar for Windows Forms 12.9.0.0_冰河之刃重打包版 --------------------11.8.0.8_冰河之刃重打包版-------------- ...

随机推荐

  1. sql索引创建

    什么是索引 拿汉语字典的目录页(索引)打比方:正如汉语字典中的汉字按页存放一样,SQL Server中的数据记录也是按页存放的,每页容量一般为4K .为了加快查找的速度,汉语字(词)典一般都有按拼音. ...

  2. 【oneday_onepage】——Microsoft to acquire Nokia's mobile phone business

    Nokia will focus on network infrastructure, mapping and locations services and technology developmen ...

  3. SpringBoot 中常用注解@Controller/@RestController/@RequestMapping的区别

    SpringBoot中常用注解@Controller/@RestController/@RequestMapping的区别 @Controller 处理http请求 @Controller //@Re ...

  4. cv_bridge中的编码模式与实现

    image_encodings.cpp文件是关于图像编码模式的源文件,其中规定了RGB的图像以及深度图的编码模式 该编码文件image_encodings.cpp所依赖的头文件图 命令空间  sens ...

  5. jquery学习心得:一个很好的css和js函数调用的例子

    统一目录下的资源结构图: <html><head> <link rel="stylesheet" href="gallery.css&quo ...

  6. python 读写二进制文件实例

    本程序,首先写入一个矩阵到二进制文件中,然后读取二进制文件恢复到另外一个矩阵中. #coding:utf--8 #https://www.cnblogs.com/cmnz/p/6986979.html ...

  7. Linux中的链接文件_软链接和硬链接

    一.链接文件介绍 Linux操作系统中的“链接文件”分为硬链接(hard link)和软链接(symbolic link).两种链接的本质区别在于inode.以下是详细介绍: 硬链接:当系统要读取一个 ...

  8. 第三百七十节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)用Django实现搜索结果分页

    第三百七十节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)用Django实现搜索结果分页 逻辑处理函数 计算搜索耗时 在开始搜索前:start_time ...

  9. 使用Eclipse的JUnit实例

    在本节中,我们将展示使用JUnit的一个完整的例子.我们将详细了解如何创建和运行测试,我们将展示如何使用特定的注释和JUnit断言. 1. 初始步骤 让我们创建一个名为 JUnitGuide 的Jav ...

  10. Unity-------------------------关于GUI绘制的编程

    转载:在这篇文章中我将给读者介绍Unity中的图形用户界面(GUI)编程.Unity有一个非常强大的GUI脚本API.它允许你使用脚本快速创建简单的菜单和GUI. 简介 Unity提供了使用脚本创建G ...