''' <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. UI设计,使用感知分层技术

    页面设计时使用感知分层技术:不同的元素用不同的颜色表示,让它看起来是位于独立的一层之上.人们在无意识的状态下,只会感知到自己关注的元素,将其他元素排除在意识之外.

  2. jQuery(十一):jQuery的事件

    一.jQuery事件的分类 jQuery事件是对JavaScript事件的封装,常用事件分类如下: 1.基础事件 window事件. 鼠标事件. 键盘事件. 表单事件. 2.复合事件是多个事件的组合 ...

  3. css实现圆形头像

    <div style="width:400px; height:90px; padding-left:10px; padding-top:10px; background-color: ...

  4. jQuery 与 prototype 共存

    方法一: <html>   <head>     <script src="prototype.js"></script>     ...

  5. 很简单的在Ubuntu系统下安装字体和切换默认字体的方法

    摘要: Ubuntu系统安装好后,默认字体对于中文的支持看上去不太美丽,于是很多朋友可能需要设置系统的默认字体为自己喜欢的字体.本文主要介绍如何解决这两个问题. 说明:测试系统是Ubuntu14.04 ...

  6. [转]浅谈Android五大布局(二)——RelativeLayout和TableLayout

    在浅谈Android五大布局(一)中已经描述了LinearLayout(线性布局).FrameLayout(单帧布局)和AbsoulteLayout(绝对布局)三种布局结构,剩下的两种布局Relati ...

  7. java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer

    hibernate查询结果条数集 原写法: Integer count = (Integer )session.createQuery(hql).uniqueResult(); 报错:java.lan ...

  8. SpringBoot系列三:SpringBoot基本概念(统一父 pom 管理、SpringBoot 代码测试、启动注解分析、配置访问路径、使用内置对象、项目打包发布)

    声明:本文来源于MLDN培训视频的课堂笔记,写在这里只是为了方便查阅. 1.了解SpringBoot的基本概念 2.具体内容 在之前所建立的 SpringBoot 项目只是根据官方文档实现的一个基础程 ...

  9. ios中layer动画和UIView动画代码总结

    kCATransitionFade淡出  kCATransitionMoveIn覆盖原图  kCATransitionPush推出  kCATransitionReveal底部显出来    pageC ...

  10. T4使用经验

    .<#@ template debug="true" hostspecific="true" language="C#" #> ...