【在线等】C# Web 如何使 textBox 显示最下面的内容? 如题,像QQ发信息后显示最下面的内容, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 this.textBox1.SelectionStart = this.textBox1.Text.Length;this.textBox1.ScrollToCaret(); 怎么我的没有SelectionStart这个属性的? string s="aaaa";textBox1.SelectedText += s + "\r\n";textBox1.ScrollToCaret(); 我的是 C# web来的 ,你的是不是winForm啊? 在Web中可以通过前台模拟的方法实现吧<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>无标题页</title> <script type="text/javascript"> var iscroll; function scrollobj(){ var obj=document.getElementById("tbSample"); obj.doScroll("pageDown"); } function beginscroll(){ var obj=document.getElementById("autoscroll"); if(obj.checked) iscroll = setInterval("scrollobj()", 10); else clearInterval(iscroll); } window.onload=beginscroll; </script></head><body> <form id="form1" runat="server"> <asp:TextBox ID="tbSample" runat="server" Height="168px" TextMode="MultiLine" Width="365px"></asp:TextBox> <br /> <input id="autoscroll" type="checkbox" checked="CHECKED" onclick="beginscroll();" />自动滚动 </form></body></html>这个与C#没有什么关系 web要在客户端用脚本来实现.与c#无关. var obj=document.getElementById("textbox1");setInterval(function(){obj.scrollTop=obj.scrollHeight;},100}; ComboBox 级联问题 asp.net出现错误 未将对象引用设置到对象的实例 C#技术书籍-电子书 关于indexof用法的问题 鼠标、键盘停止操作一段时间会不会触发什么事件? 30分刷一次``如何结束进程 江湖救急!同时向2个表中插入不同数据 mcisendstring 获取当前的播放状态总是为空 找共同学习C#的朋友:) 真心求教:我的未来:C# OR JAVA? 难道没人懂接口了????????? 帮忙看一下gridview 中插入,删除代码 其中sqlsource是配置的 提示在where 处有错误 OID为主键 自增
this.textBox1.SelectionStart = this.textBox1.Text.Length;
this.textBox1.ScrollToCaret();
怎么我的没有SelectionStart这个属性的?
textBox1.SelectedText += s + "\r\n";
textBox1.ScrollToCaret();
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
var iscroll;
function scrollobj(){
var obj=document.getElementById("tbSample");
obj.doScroll("pageDown");
}
function beginscroll(){
var obj=document.getElementById("autoscroll");
if(obj.checked)
iscroll = setInterval("scrollobj()", 10);
else
clearInterval(iscroll);
}
window.onload=beginscroll;
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="tbSample" runat="server" Height="168px" TextMode="MultiLine" Width="365px"></asp:TextBox>
<br />
<input id="autoscroll" type="checkbox" checked="CHECKED" onclick="beginscroll();" />自动滚动
</form>
</body>
</html>
这个与C#没有什么关系
setInterval(function(){obj.scrollTop=obj.scrollHeight;},100};