c 多行文本框框1a

如何将可拖动的多行文本框设置为不可拖动
[问题点数:20分,结帖人HiYooa]
如何将可拖动的多行文本框设置为不可拖动
[问题点数:20分,结帖人HiYooa]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
2012年 总版技术专家分年内排行榜第一2007年 总版技术专家分年内排行榜第二2006年 总版技术专家分年内排行榜第二2004年 总版技术专家分年内排行榜第二
2005年 总版技术专家分年内排行榜第三2003年 总版技术专家分年内排行榜第三2002年 总版技术专家分年内排行榜第三
2012年 总版技术专家分年内排行榜第一2007年 总版技术专家分年内排行榜第二2006年 总版技术专家分年内排行榜第二2004年 总版技术专家分年内排行榜第二
2005年 总版技术专家分年内排行榜第三2003年 总版技术专家分年内排行榜第三2002年 总版技术专家分年内排行榜第三
本帖子已过去太久远了,不再提供回复功能。二次元同好交流新大陆
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(2171)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'多行文本框的换行问题',
blogAbstract:'&&&&&&&& 做了一个公告添加页面,里面使用多行文本框来添加公告内容,发现提交了之后,显示出来,没有换行和空格了。后来查了些资料才知道,由于在TextBox中换行都是\"\\n\",在浏览器端进行显示时当然不认的,所以在显示之前需要将\"\\n\"转换成\"&br&\"。\r\n&&&&&&&& 方法如下:\r\n&&&&&&&& string Content= TextBox1.Text.Replace(\"\\n\", \"&br&\");//将回车替换成html中的换行标记\r\n&&&&&&&&&Content=Content.Replace(\" \", \"&&\");//将空格替换了,为了保证空格在中文状态下显示正常,用了两个&',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:9,
publishTime:7,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}C# 字符串多行显示/文本换行以textbox为例讲解
字体:[ ] 类型:转载 时间:
C# 字符串多行显示、文本换行以textbox为例讲为大家详细介绍并附演示效果图及演示代码,感兴趣的朋友可以了解下,或许对你学习字符串换行有所帮助
方法1:以textbox为例
①:先设置textbox的属性Multiline为true
②:组织好显示字符串:FistLine(第一行要显示的字符)、SecondLine(第二行要显示的字符)、。。。。。。。、第n行字符
③textbox.text="FistLine"+System.Environment.NewLine+"SecondLine"+System.Environment.NewLine+。。。。+"第N&行"+System.Environment.NewLine
当你看到上面代码的时候可能会认为我们一般用的换行符不是"\r\n"吗
你会想到这种方式:textbox.text="FistLine"+“\r\n”+"SecondLine"+"\r\n"+。。。。+"第N&行"+"\r\n"
这种格式可能在运行时也不会出错,但在Linux操作系统或其他系统可能就会出错
WinForm的 textbox截图效果:
Textbox例子1用("\r\n"):具体代码: 代码如下:/// &summary& /// 将结果填充到会员预定情况框 /// &/summary& /// &param name="dt"&&/param& private void BindGuestOrder(DataTable dt) { int intRowsC intRowsCount = dt.Rows.C string[] strName = new string[intRowsCount]; string[] strPhone = new string[intRowsCount]; string[] strRoom = new string[intRowsCount]; string[] strNum = new string[intRowsCount]; string[] strTime = new string[intRowsCount]; for (int intRows = 0; intRows & intRowsC intRows++) { strName[intRows] = dt.Rows[intRows]["GuestName"].ToString(); strPhone[intRows] = dt.Rows[intRows]["LinkPhone"].ToString(); strRoom[intRows] = dt.Rows[intRows]["RoomName"].ToString(); strNum[intRows] = dt.Rows[intRows]["BookNo"].ToString(); strTime[intRows] = dt.Rows[intRows]["DineTime"].ToString(); AddMsgToTextBox("客人姓名:" + strName[intRows]); AddMsgToTextBox("客人电话:" + strPhone[intRows]); AddMsgToTextBox("预定房间:" + strRoom[intRows]); AddMsgToTextBox("预约号:" + strNum[intRows]); AddMsgToTextBox("预定时间:" + strTime[intRows]); } } private int intCounts = 1; /// &summary& /// 显示多行文本 /// &/summary& /// &param name="s"&&/param& public void AddMsgToTextBox(string s) { int intCount1; intCount1 = intCounts / 5; CheckTextBox(intCount1); txtVIPAdvanceOrder.Text += "\r\n" + if (intCounts % 5 == 0) { txtVIPAdvanceOrder.Text += "\r\n"; } intCounts++; } /// &summary& /// 设置换行 /// &/summary& protected void CheckTextBox(int intCount1) { int iLines = 5 * (intCount1 + 2); //想显示多少行。 string stxt = txtVIPAdvanceOrder.T string[] s = stxt.Split('\n'); if (s.Length & iLines)
txtVIPAdvanceOrder.Text = ""; for (int i = 1; i & s.L i++) { txtVIPAdvanceOrder.Text += s[i] + "\r\n"; } stxt = txtVIPAdvanceOrder.T if (stxt != "") txtVIPAdvanceOrder.Text = stxt.Substring(0, stxt.Length - 1); } 例子2:截图效果(dev 控件(Memoedit)):
源码: 代码如下:/// &summary& /// 将结果填充到会员预定情况框 /// &/summary& /// &param name="dt"&预定会员的信息表&/param& private void BindGuestOrder(DataTable vardt) { memGusetInfo.Text = ""; int tmpRowsC tmpRowsCount = vardt.Rows.C string[] tmpstrName = new string[tmpRowsCount]; string[] tmpstrPhone = new string[tmpRowsCount]; string[] tmpstrRoom = new string[tmpRowsCount]; string[] tmpstrNum = new string[tmpRowsCount]; string[] tmpstrTime = new string[tmpRowsCount]; for (int i = 0; i & tmpRowsC i++) { tmpstrName[i] = vardt.Rows[i]["GuestName"].ToString(); tmpstrPhone[i] = vardt.Rows[i]["LinkPhone"].ToString(); tmpstrRoom[i] = vardt.Rows[i]["RoomName"].ToString(); tmpstrNum[i] = vardt.Rows[i]["BookNo"].ToString(); tmpstrTime[i] = vardt.Rows[i]["DineTime"].ToString(); string tmpstr1 = "客人姓名:" + tmpstrName[i] + System.Environment.NewL string tmpstr2 = "客人电话:" + tmpstrPhone[i] + System.Environment.NewL string tmpstr3 = "预定房间:" + tmpstrRoom[i] + System.Environment.NewL string tmpstr4 = "预约号:" + tmpstrNum[i] + System.Environment.NewL string tmpstr5 = "预约时间:" + tmpstrTime[i] + System.Environment.NewL memGusetInfo.Text += string.Format("{0}{1}{2}{3}{4}", tmpstr1, tmpstr2, tmpstr3, tmpstr4, tmpstr5) + System.Environment.NewL } } 现在DEV控件比较多人用:所以弄了一个DEV的例子,DEV有专门的文本框控件(Memoedit)其实原理都一样,效果也差不多
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具php 批量添加 多行文本框 textarea - 推酷
php 批量添加 多行文本框 textarea
$act=!empty($_GET['act']) ? trim($_GET['act']) : '';
switch($act) {
case 'adda':
$area['a_value'] = trim($_POST['a_value']);
$area['a_type']=3;
if(strpos($area['a_value'], &\n&) === false) {
//echo $area['a_value'];
//add($area);
//$DB-&insert('bcrh_article_attr',$area);
$areanames = explode(&\n&, $area['a_value']);
foreach($areanames as $areaname) {
$areaname = trim($areaname);
if(!$areaname)
//echo $areaname.'|';
$area['a_value'] = $
//$DB-&insert('bcrh_article_attr',$area);
header(&refresh:0;url=gfxrtz.php&);//跳转页面,注意路径
&form method=&post& action=&?act=adda& onsubmit=&return Dcheck();& &
&table cellpadding=&2& cellspacing=&1& class=&tb&&
&td class=&tl&&&span class=&f_hid&&*&/span& 属性&/td&
&textarea name=&a_value&
id=&a_value& style=&width:200height:100overflow:&&&/textarea&
允许批量添加,一行一个,点回车换行&/td&
&div class=&sbt&&&input type=&submit& name=&submit& value=&确 定& class=&btn&&
&input type=&reset& name=&reset& value=&重 置& class=&btn&&&/div&
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
主题不准确
没有分页内容
图片无法显示
视频无法显示
与原文不一致11200人阅读
&mce:script type="text/javascript"&&!--
Ext.form.TextArea独有配置表:
preventScrollbars
文本溢出是否显示滚动条,true隐藏滚动条(默认false)
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = '../extjs2.0/resources/images/default/s.gif';
//Ext.QuickTips.init();
var config = {
title:'Ext.form.TextArea示例',
labelSeparator:':',
labelWidth:60,
bodyStyle:'padding:5 5 5 5',
frame:true,
height:150,
width:250,
renderTo:'form',
new Ext.form.TextArea({
id:'memo',
widht:150,
fieldLabel:'备注'
{text:'确定',handler:showValue}
var form = new Ext.form.FormPanel(config);
//单击按钮后事件处理
function showValue()
var memo = form.findById('memo');
//取得输入框控件
var config = {
title:'TextArea值是:',
msg:memo.getValue(),
//取得控件值
Ext.Msg.show(config);
// --&&/mce:script&
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:493531次
积分:7171
积分:7171
排名:第2048名
原创:234篇
转载:24篇
评论:69条
(5)(3)(1)(2)(4)(14)(1)(1)(1)(3)(7)(11)(12)(10)(5)(3)(4)(6)(1)(1)(2)(6)(1)(8)(8)(25)(8)(61)(44)

我要回帖

更多关于 html5多行文本框 的文章

 

随机推荐