找回密码
 立即注册

QQ登录

只需一步,快速开始

AVRANK

中级会员

20

主题

33

帖子

513

积分

中级会员

积分
513

活字格认证

[已处理] 文字自动折行

AVRANK
中级会员   /  发表于:2011-6-16 20:29  /   查看:7859  /  回复:3
单元格中,文字长度超过单元格宽度时,文字自动折行如何实现?我用的VB6.0

3 个回复

倒序浏览
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2011-6-16 21:08:00
沙发
你使用的VB6.0,那你使用的是Spread的什么版本呢

Spread for Windows Forms 5 中你可以使用TextCellType或者RichTextBoxCellType来设置自动换行,例如:

  1.             RichTextCellType rtCell = new RichTextCellType();
  2.             rtCell.WordWrap = true;

  3.             this.fpSpread1.ActiveSheet.Cells[0, 0].CellType = rtCell;
复制代码
回复 使用道具 举报
zhaoyuanxu
中级会员   /  发表于:2014-8-6 11:28:00
板凳
回复 2楼dof的帖子

vb6  spread8  怎么实现换行呢
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2014-8-6 16:28:00
地板
回复 3楼zhaoyuanxu的帖子

请通过以下代码测试:

  1. fpSpread1.Col = 2
  2. fpSpread1.Row = 3
  3. ' Define cell type as static
  4. fpSpread1.CellType = CellTypeStaticText
  5. ' Provide text for the specified cell
  6. fpSpread1.Text = "Select one of the following"
  7. ' Set the text to wrap to multiple lines
  8. fpSpread1.TypeTextWordWrap = True
  9. ' Set vertical alignment to center
  10. fpSpread1.TypeVAlign = TypeVAlignCenter
  11. ' Set horizontal alignment to center
  12. fpSpread1.TypeHAlign = TypeHAlignCenter
  13. ' Set row height of specified row
  14. fpSpread1.RowHeight(3) = 38
  15. ' Set column width of specified column
  16. fpSpread1.ColWidth(2) = 9
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部