77范文网 - 专业文章范例文档资料分享平台

Farpoint-中文手册(3)

来源:网络收集 时间:2019-06-17 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

FpSpread1.Sheets(0).Columns(7).Width = 125

从例子入门:创建Checkbook Register 8

产品网站 http://www.grapecity.cn/tools 技术支持论坛http://gcdn.grapecity.com

示例:设置数字单元格类型到Check #列 示例:设置日期单元格类型到Date 列

[C#]

// 把Check #列的单元格类型设置成数字

FarPoint.Win.Spread.CellType.NumberCellType objNumCell = new FarPoint.Win.Spread.CellType.NumberCellType(); objNumCell.DecimalPlaces = 0; objNumCell.MinimumValue = 1; objNumCell.MaximumValue = 9999; objNumCell.ShowSeparator = false;

fpSpread1.Sheets[0].Columns[0].CellType = objNumCell;

[Visual Basic]

'把Check #列的单元格类型设置成数字

Dim objNumCell As New FarPoint.Win.Spread.CellType.NumberCellType() objNumCell.DecimalPlaces = 0 objNumCell.MinimumValue = 1 objNumCell.MaximumValue = 9999 objNumCell.ShowSeparator = False

FpSpread1.Sheets(0).Columns(0).CellType = objNumCell

[C#]

// 把Date 列的单元格类型设置成日期

FarPoint.Win.Spread.CellType.DateTimeCellType objDateCell = new

FarPoint.Win.Spread.CellType.DateTimeCellType(); objDateCell.DateTimeFormat =

FarPoint.Win.Spread.CellType.DateTimeFormat.ShortDate; fpSpread1.Sheets[0].Columns[1].CellType = objDateCell;

[Visual Basic]

'把Date 列的单元格类型设置成日期

Dim objDateCell As New FarPoint.Win.Spread.CellType.DateTimeCellType() objDateCell.DateTimeFormat =

FarPoint.Win.Spread.CellType.DateTimeFormat.ShortDate FpSpread1.Sheets(0).Columns(1).CellType = objDateCell

从例子入门:创建Checkbook Register 9

产品网站 http://www.grapecity.cn/tools 技术支持论坛http://gcdn.grapecity.com

示例:设置文本单元格类型到Description 列

示例:设置单选框单元格类型到“Tax?” 和“Cleared?”列

[C#]

// 把Description 列单元格类型设置成文本类型

FarPoint.Win.Spread.CellType.TextCellType objTextCell = new FarPoint.Win.Spread.CellType.TextCellType(); objTextCell.MaxLength = 100;

fpSpread1.Sheets[0].Columns[2].CellType = objTextCell;

[Visual Basic]

'把Description 列单元格类型设置成文本类型

Dim objTextCell As New FarPoint.Win.Spread.CellType.TextCellType() objTextCell.MaxLength = 100

FpSpread1.Sheets(0).Columns(2).CellType = objTextCell

[C#]

//把“Tax? ” 和“ Cleared?” 列的单元格类型设置成单选框类型 FarPoint.Win.Spread.CellType.CheckBoxCellType objCheckCell = new FarPoint.Win.Spread.CellType.CheckBoxCellType(); objCheckCell.ThreeState = false;

fpSpread1.Sheets[0].Columns[3].CellType = objCheckCell; fpSpread1.Sheets[0].Columns[4].CellType = objCheckCell;

[Visual Basic]

'把“Tax? ”和“ Cleared? ”列的单元格类型设置成单选框类型

Dim objCheckCell As New FarPoint.Win.Spread.CellType.CheckBoxCellType() objCheckCell.ThreeState = False

FpSpread1.Sheets(0).Columns(3).CellType = objCheckCell FpSpread1.Sheets(0).Columns(4).CellType = objCheckCell

从例子入门:创建Checkbook Register 10

产品网站 http://www.grapecity.cn/tools 技术支持论坛http://gcdn.grapecity.com

示例:设置货币框单元格类型到Debit,Credit 和Balance 列

保存您的工程然后从“编译”菜单中选择“开始”来运行您的工程。存储工程,选择“编译”菜单

“开始”运行程序。 您的窗体将会如下图:

1.4 添加公式

您的工程现在看起来像一个支票登记薄。但是,在您登记的时候它不会自动计算收支平衡。 下列步骤通过Spread 提供的公式功能来自动计算收支平衡。

[C#]

// 把Debit, Credit 和 Balance 列的单元格类型设置成货币类型

FarPoint.Win.Spread.CellType.CurrencyCellType objCurrCell = new FarPoint.Win.Spread.CellType.CurrencyCellType();

objCurrCell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes; objCurrCell.NegativeRed = true; objCurrCell.FixedPoint = true;

fpSpread1.Sheets[0].Columns[5].CellType = objCurrCell; fpSpread1.Sheets[0].Columns[6].CellType = objCurrCell; fpSpread1.Sheets[0].Columns[7].CellType = objCurrCell;

[Visual Basic]

'把Debit, Credit 和Balance 列的单元格类型设置成货币类型

Dim objCurrCell As New FarPoint.Win.Spread.CellType.CurrencyCellType() objCurrCell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes objCurrCell.NegativeRed = True objCurrCell.FixedPoint = True

FpSpread1.Sheets(0).Columns(5).CellType = objCurrCell FpSpread1.Sheets(0).Columns(6).CellType = objCurrCell FpSpread1.Sheets(0).Columns(7).CellType = objCurrCell

从例子入门:创建Checkbook Register 11

产品网站 http://www.grapecity.cn/tools 技术支持论坛http://gcdn.grapecity.com

示例

保存您的工程,从“编译”菜单中选择“开始”来运行您的工程。

此时您的窗体应该看起来如下图所示。输入数据来测试一下它是否正常工作吧!

现在,您已经用Spread 控件成功地创建了一个Checkbook Register。您已经完成了这个教程。

[C#]

// 设置公式计算收支平衡

fpSpread1.Sheets[0].ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1; int i;

for (i = 0; i <= fpSpread1.ActiveSheet.RowCount ‐ 1; i++) {

if (i == 0)

fpSpread1.Sheets[0].Cells[i, 7].Formula = \ else

fpSpread1.Sheets[0].Cells[i, 7].Formula = \ }

[Visual Basic]

'设置公式计算收支平衡

FpSpread1.Sheets(0).ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1 Dim i As Integer

For i = 0 To FpSpread1.ActiveSheet.RowCount ‐ 1 If i = 0 Then

FpSpread1.Sheets(0).Cells(i, 7).Formula = \\Else

FpSpread1.Sheets(0).Cells(i, 7).Formula = \ End If Next

Spread 产品介绍 12

产品网站 http://www.grapecity.cn/tools 技术支持论坛http://gcdn.grapecity.com

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库Farpoint-中文手册(3)在线全文阅读。

Farpoint-中文手册(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/662972.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: