SPREAD for Windows Forms 下箭头追加行
''' <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 下箭头追加行的更多相关文章
- SPREAD for Windows Forms 代码片段
'スクロールバーの移動 FpSpread1.ShowColumn(, , HorizontalPosition.Left) 'SetActiveCellの後.LeaveCellを呼び出す Dim ss ...
- SPREAD for Windows Forms 控制输入法
enc = System.Text.Encoding.GetEncoding("shift-jis") datamodel = CType(FpSpread1.ActiveShee ...
- Eclipse中快捷键Ctrl + Alt + 向上箭头 或者 Ctrl + Alt + 向下箭头与Windows冲突
原文地址:https://blog.csdn.net/buaaroid/article/details/50804608 clipse中按ctrl + alt + 向上箭头没有任何反应,按ctrl + ...
- Windows 下的高 DPI 应用开发(UWP / WPF / Windows Forms / Win32)
本文将介绍 Windows 系统中高 DPI 开发的基础知识.由于涉及到坐标转换,这种转换经常发生在计算的不知不觉中:所以无论你使用哪种 Windows 下的 UI 框架进行开发,你都需要了解这些内容 ...
- Windows Forms和WPF在Net Core 3.0框架下并不会支持跨平台
Windows Forms和WPF在Net Core 3.0框架下并不会支持跨平台 微软将WinForms和WPF带到.NET Core 3.0这一事实,相信大家都有所了解,这是否意味着它在Linux ...
- .net chart(图表)控件的使用-System.Windows.Forms.DataVisualization.dll
这个案例指在介绍微软这套免费又功能强大的图表控件Microsoft Chart Controls for Microsoft .NET Framework 3.5,通过它,可让您的项目及报表,轻松套用 ...
- 如何重载ComboBox 使其下拉按钮(带下箭头的)和下拉列表的垂直滚动条的宽度改变?(自绘ComboBox) [转]
原文地址:http://bbs.csdn.net/topics/390135022 http://blog.csdn.net/scsdn/article/details/4363299 想使用winf ...
- Wizard Framework:一个自己开发的基于Windows Forms的向导开发框架
最近因项目需要,我自己设计开发了一个基于Windows Forms的向导开发框架,目前我已经将其开源,并发布了一个NuGet安装包.比较囧的一件事是,当我发布了NuGet安装包以后,发现原来已经有一个 ...
- DotNetBar for Windows Forms 12.9.0.0_冰河之刃重打包版及制作Visual Studio C#项目模板文件详解
关于 DotNetBar for Windows Forms 12.9.0.0_冰河之刃重打包版 --------------------11.8.0.8_冰河之刃重打包版-------------- ...
随机推荐
- java socket 服务端 客户端
Server package com.witwicky.socket.basicsocket; import java.io.IOException; import java.io.InputStre ...
- jquery ajax 无刷新上传
var form = new FormData(); form.append('file', $("#submitmaterials").find("input" ...
- js学习(三)-使用大括号({ })语法创建无类型对象
//----------------------js代码------------------- var user = { name:'tom', say:function(){ console.log ...
- 微信SDK 报错 invalid url domanin
刚开始我在安全JS域名下填写: Http://hgj123.8.yydns.pw 带了Http 在微信中开打自己写好demo.报invalid url domanin 说我的无效URL. 然后我在 ...
- 构建Java并发模型框架
Java的多线程特性为构建高性能的应用提供了极大的方便,但是也带来了不少的麻烦.线程间同步.数据一致性等烦琐的问题需要细心的考虑,一不小心就会出现一些微妙的,难以调试的错误.另外,应用逻辑和线程逻辑纠 ...
- 初探Asp.net请求机制原理 1
web原理 请求---响应 而一个 简单的请求 响应中包含太多知识,只有把 请求响应原理搞懂才能在web的世界里好好翱翔(注:自已的整理的知识参考博友们东西或自已所想,没有盗版权的意思,在此说明就不引 ...
- ubantu linux的bash shell初接触
本人是Linux初习者,同时也刚刚开始学习,将我的学习成长记录下来,来和大家一同分享! 我用的系统是Ubuntu 12.04,脚本编辑器用的是VIM,觉得很顺手!Shell语言用的是Bash Shel ...
- 1<<30 hashMap 中使用位移运算的意义
static final int MAXIMUM_CAPACITY = 1 << 30; 计算过程已1<<30为例,首先把1转为二进制数字 0000 0000 0000 000 ...
- python 搜索引擎Whoosh中文文档和代码 以及jieba的使用
注意, 数据库的表最好别有下划线 中文文档链接: https://mr-zhao.gitbooks.io/whoosh/content/%E5%A6%82%E4%BD%95%E7%B4%A2%E5%B ...
- (笔记)Mysql命令create table:创建数据表
create table命令用来创建数据表. create table命令格式:create table <表名> (<字段名1> <类型1> [,..<字段 ...