''' <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. Swift的函数与函数指针、闭包Closure等相关内容介绍

    <span style="font-size:24px;">//函数 //demo1 无參数类型 func testConcat(){ println("測试 ...

  2. 链接克隆、完整克隆 vmware 快照和克隆

    多重快照功能简介: 快照的含义:对某一个特定文件系统在某一个特定时间内的一个具有只读属性的镜像.当你需要重复的返回到某一系统状态,又不想创建多个虚拟机的时候,就可以使用快照功能.其实,快照并不是VMw ...

  3. SpringCloud微服务部署

    https://blog.csdn.net/weixin_36397925/article/details/79496657 https://blog.csdn.net/forezp/article/ ...

  4. C++标准 bind函数用法与C#简单实现

    在看C++标准程序库书中,看到bind1st,bind2nd及bind的用法,当时就有一种熟悉感,仔细想了下,是F#里提到的柯里化.下面是维基百科的解释:在计算机科学中,柯里化(英语:Currying ...

  5. 实践:C++平台迁移以及如何用C#做C++包装层

    在前面,我们看过OpenTK与MOgre,这二个项目都是C#项目,但是他的实现都是C++.他们简单来说就是一个包装层.常见的包装方式有二种,一种就是我们熟知的显式P/Invoke(DllImport) ...

  6. 【Vue】VS Code+Vue入门 Helloworld

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. 第三百八十三节,Django+Xadmin打造上线标准的在线教育平台—第三方模块django-simple-captcha验证码

    第三百八十三节,Django+Xadmin打造上线标准的在线教育平台—第三方模块django-simple-captcha验证码 下载地址:https://github.com/mbi/django- ...

  8. 阿里技术嘉年华-aDev内容感悟

    之前参见了ADC然后要求在组内做了个简单的分享,因为写这个PPT的时候ADC的资料还没分享,所以仅凭自己记忆写的一点感悟罢了. PPT下载

  9. Java如何显示小时和分钟?

    在Java中,如何显示小时和分钟(当前时间)? 此示例演示如何使用Calender类的Calender.getInstance()来显示某个时刻的小时和分钟. package com.yiibai; ...

  10. 使用@Ignore注解

    断续上一节的例子,了解如何使用@Ignore注解.在测试类FirstDayAtSchoolTest中,我们将添加@Ignore注解到testAddPencils()方法.以这种方式,我们期望这个测试方 ...