''' <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. linux服务器的性能分析与优化(十三)

    [教程主题]:1.linux服务器的性能分析与优化 [主要内容] [1]影响Linux服务器性能的因素 操作系统级 Ø CPU 目前大部分CPU在同一时间只能运行一个线程,超线程的处理器可以在同一时间 ...

  2. C#内置泛型委托:Func委托

    1.什么是Func委托 Func委托代表有返回类型的委托 2.Func委托定义 查看Func的定义: using System.Runtime.CompilerServices; namespace ...

  3. CSS(九):设置盒子水平垂直居中

    通过设置下面的样式可以使盒子水平垂直居中: <!DOCTYPE html> <html lang="en"> <head> <meta c ...

  4. SwipeBackLayout侧滑返回显示桌面

    SwipeBackLayout是一个很好的类库,它可以让Android实现类似iOS系统的右滑返回效果,但是很多用户在使用官方提供的Demo会发现,可能出现黑屏或者返回只是看到桌面背景而没有看到上一个 ...

  5. 远程操作与端口转发 SSH原理与运用

    SSH不仅可以用于远程主机登录,还可以直接在远程主机上执行操作. 上一节的操作,就是一个例子: $ ssh user@host 'mkdir -p .ssh && cat >&g ...

  6. Cocos2d-x绘制圆角矩形

    /* * @brief 画圆角矩形 * @param origin 矩形开始点 * @param destination 矩形结束点 * @param radius 圆角半径 * @param seg ...

  7. Mac 系统上安装Protocol buffer

    1. cd /Software/protobuf-2.5.0 2.sudo ./configure --prefix=$/Software/protobuf-2.5.0 3.sudo make 4.s ...

  8. 嵌入式开发值zynq驱动—— zynq SPI Flash 驱动过程

    http://blog.csdn.net/pengwangguo/article/details/52292664 http://blog.csdn.net/pengwangguo/article/d ...

  9. js Jquery字符UrlEncode 编码 C#(asp.net)解码 Server HttpUtility 区别 cookies存中文

    一.Js asp.net 交互Url编码解码 C#(asp.net)编码:HttpUtility.UrlEncode(url) Jquery解码:decodeURIComponent(url); Jq ...

  10. Drools 语法

    Drools 语法 规则语法 package: package 的名字是随意的,不必必须对应物理路径 import: 导入外部变量 规则的编译与运行要通过Drools 提供的各种API 来实现.API ...