如题,怎么才能把长篇文章按页显示在richtextbox里面,点击自定义按钮进行翻页!最好有代码,是c#2.0的!因为我用的是vs2005。
解决方案 »
- 再简单不过的事务
- net中调取数据输出的问题,新手请教!
- 如何用c#做一个网页生成简单的增加删除修改存储过程请大家说说自己的看法看说的方法好
- 如何不让自己的程序被强制删除
- C#中怎样去除字符串中的回车?
- 马甲贴 - - 类似于visio的工具栏的控件的开发
- xtjs2.2中在c#返回数据result.id如何表示
- 线程委托的事件有参数怎么办?
- 客户端调用Remoting中远程对象的方法,定期的打开和关闭数据库,每当调用到8、9次的时候就会报错:
- sqlserver数据库有千万数据,插入数据和更新数据CPU占用100%的问题
- 问下在c/s下有Wizard控件么?
- 当鼠标移到图片上则鼠标指针改变如何实现?
private void pageup_Click(object sender, EventArgs e)
{
int sindex = richTextBox1.GetCharIndexFromPosition(new Point(1, 1));
int eindex = richTextBox1.GetCharIndexFromPosition(new Point(richTextBox1.Width - 1, richTextBox1.Height - 1));
int line;
if (richTextBox1.GetPositionFromCharIndex(eindex).Y < richTextBox1.Height - richTextBox1.SelectionFont.Height)
{
int height = richTextBox1.Height - richTextBox1.GetPositionFromCharIndex(eindex).Y;
height = height / richTextBox1.SelectionFont.Height - 1;
line = richTextBox1.GetLineFromCharIndex(sindex) - richTextBox1.GetLineFromCharIndex(eindex) - height;
}
else
{
line = richTextBox1.GetLineFromCharIndex(sindex) - richTextBox1.GetLineFromCharIndex(eindex);
}
SendMessage(this.richTextBox1.Handle, 0xB6, 0, line); } private void pagedownt_Click(object sender, EventArgs e)
{
int sindex = richTextBox1.GetCharIndexFromPosition(new Point(1, 1));
int eindex = richTextBox1.GetCharIndexFromPosition(new Point(richTextBox1.Width - 1, richTextBox1.Height - 1));
int lines = 0;
if (eindex < this.richTextBox1.Text.Length - 1)
{
lines = richTextBox1.GetLineFromCharIndex(eindex) - richTextBox1.GetLineFromCharIndex(sindex);
}
SendMessage(this.richTextBox1.Handle, 0xB6, 0, lines); }