请教:如何动态绑定TextBox的TextMode,我用TextBox1.TextMode ="MultiLine"提示出错!

jijiqimao 2003-10-16 08:56:33
D:\01as_web\edu\7.aspx.cs(25): 无法将类型“string”隐式转换为“System.Web.UI.WebControls.TextBoxMode”
...全文
45 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
saucer 2003-10-16
  • 打赏
  • 举报
回复

TextBox1.TextMode = TextBoxMode.MultiLine
无线条码打印机源代码: private System.Windows.Forms.TextBox InputTextBox; private System.Windows.Forms.Label label1; private SerialAPI.SerialPort Serial=new SerialAPI.SerialPort(); private System.Windows.Forms.OpenFileDialog openFileDialog1; private Microsoft.WindowsCE.Forms.InputPanel inputPanel1; private System.Windows.Forms.MainMenu mainMenu1; private System.Windows.Forms.MenuItem menuItem1; private System.Windows.Forms.Button ConfigeButton; public string BluetoothComPort="COM8:"; public string IRComPort="COM3:"; public string ComPort="Bluetooth"; private System.Windows.Forms.Button PrintButton; private System.Windows.Forms.Button OpenFileButton; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; public string Port; public Form1() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // } /// /// 清理所有正在使用的资源。 /// protected override void Dispose( bool disposing ) { base.Dispose( disposing ); } #region Windows 窗体设计器生成的代码 /// /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// private void InitializeComponent() { this.InputTextBox = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.PrintButton = new System.Windows.Forms.Button(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.OpenFileButton = new System.Windows.Forms.Button(); this.inputPanel1 = new Microsoft.WindowsCE.Forms.InputPanel(); this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.ConfigeButton = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); // // InputTextBox // this.InputTextBox.Location = new System.Drawing.Point(8, 24); this.InputTextBox.Multiline = true; this.InputTextBox.Size = new System.Drawing.Size(224, 176); this.InputTextBox.Text = "  VMP01 PLUS便携式微型打印机是VMP01系列微型打印机的升级版,除了具有VMP01系列微型打印机同样出色的性能外,在打印质量以及使用方便性上有了提升," + "该微型打印机采用32位ARM CPU作为中央处理器及先进的富士通打印机芯,大大提高了打印速度。为了避免各种票据打印中频繁出现的生僻字(特别是人名),采用了包含2" + "万多汉字的大容量GBK字库。该微型打印机广泛应用在物流、交警、邮政、城管、烟草、抄表等等领域。\r\n\r\n\r\n"; // // label1 // this.label1.Location = new System.Drawing.Point(88, 8); this.label1.Size = new System.Drawing.Size(56, 16); this.label1.Text = "打印内容"; // // PrintButton // this.PrintButton.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular); this.PrintButton.Location = new System.Drawing.Point(8, 208); this.PrintButton.Size = new System.Drawing.Size(56, 22); this.PrintButton.Text = "打印"; this.PrintButton.Click += new System.EventHandler(this.PrintButton_Click); // // openFileDialog1 // this.openFileDialog1.FileName = "发送文件"; this.openFileDialog1.Filter = "文本文件|*.txt"; // // OpenFileButton // this.OpenFileButton.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular); this.OpenFileButton.Location = new System.Drawing.Point(168, 208); this.OpenFileButton.Size = new System.Drawing.Size(64, 22); this.OpenFileButton.Text = "打开文件"; this.OpenFileButton.Click += new System.EventHandler(this.OpenFileButton_Click); // // mainMenu1 // this.mainMenu1.MenuItems.Add(this.menuItem1); // // menuItem1 // this.menuItem1.Text = "退出"; this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); // // ConfigeButton // this.ConfigeButton.Location = new System.Drawing.Point(88, 208); this.ConfigeButton.Size = new System.Drawing.Size(56, 22); this.ConfigeButton.Text = "设置"; this.ConfigeButton.Click += new System.EventHandler(this.ConfigeButton_Click); // // button1 // this.button1.Location = new System.Drawing.Point(8, 238); this.button1.Size = new System.Drawing.Size(56, 22); this.button1.Text = "条码打印"; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.Location = new System.Drawing.Point(144, 238); this.button2.Size = new System.Drawing.Size(88, 22); this.button2.Text = "格式文本打印"; this.button2.Click += new System.EventHandler(this.button2_Click); // // Form1 // this.BackColor = System.Drawing.Color.WhiteSmoke; this.ClientSize = new System.Drawing.Size(240, 348); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.Controls.Add(this.ConfigeButton); this.Controls.Add(this.OpenFileButton); this.Controls.Add(this.PrintButton); this.Controls.Add(this.label1); this.Controls.Add(this.InputTextBox); this.MaximizeBox = false; this.Menu = this.mainMenu1; this.MinimizeBox = false; this.Text = "VMP01 PLUS PRINT DEMO"; } #endregion /// /// 应用程序的主入口点。 /// static void Main() { Application.Run(new Form1()); } private void PrintButton_Click(object sender, System.EventArgs e) { if(InputTextBox.TextLength==0) { return; } this.PrintButton.Enabled=false; this.PrintButton.Update(); Vmp01plusPrint(InputTextBox.Text); this.PrintButton.Enabled=true; } private void OpenFileButton_Click(object sender, System.EventArgs e) { this.OpenFileButton.Enabled=false; this.OpenFileButton.Update(); OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ; openFileDialog1.FilterIndex = 2 ; //读取文本文件并显示 if(openFileDialog1.ShowDialog() == DialogResult.OK) { if (openFileDialog1.FileName!="") { byte[] OutBuffer; FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); OutBuffer = new byte[fs.Length]; OutBuffer=r.ReadBytes((int)fs.Length); fs.Close(); //显示GB编码文本 Encoding ANSIEncoding = Encoding.GetEncoding(0);//or GetEncoding(936); Encoding UnicodeEncoding = Encoding.Unicode; 。。。。。。。。。。。。。。。。。
.net环境下ckeditor与ckfinder学习笔记 ckeditor 3.0.1学习笔记 一.ckeditor 3.0.1精简 精简前:4.52M 精简后:853K 1.删除_samples和_source文件夹,分别为示例文件和未压缩源程序 2.删除lang文件夹下除zh-cn.js,en.js下的所有语言文件.根据需要删除 3.删除根目录下的changes.html(更新列表),install.html(安装指向),license.html(使用许可). 4.删除skins目录下不需要的皮肤.我一般用V2(简单.朴素) //如果只保留V2则必须在config.js中指定皮肤 二.ckeditor 3.0.1相关文件配置路径 1./ckeditor.js 核心文件,调用需加载 2./config.js 配置文件,参数配置均在此完成 3./plugins/smiley/images 表情符号. 三.ckeditor应用(.net环境) 1.引用js脚本 <script type="text/javascript" src="ckeditor/ckeditor.js">TextBox ID="TextBox1" runat="server" Rows="10" TextMode="MultiLine">TextBox> <script type="text/javascript">CKEDITOR.replace('TextBox1')Text', 'PasteFromWord', ], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'], '/', ['Bold', 'Italic', 'Underline', '-', 'Subscript', 'Superscript'], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'Anchor'], '/', ['Format', 'Font', 'FontSize'], ['TextColor', 'BGColor'], ['Maximize', 'ShowBlocks', '-', 'About'] ]; ckfinder学习笔记 一.ckfinder精简 精简前:1.10M 精简后:947K 1.删除_samples和_source文件夹,分别为示例文件和未压缩源程序 2.删除根目录下changelog.txt,install.txt,license.txt文件 3.删除core/lang目录下除en.js,zh-cn.js的所有语言文件(根据条件删除) 二.ckfinder配置 1.复制/bin目录下的ckfinder.dll文件至站点bin目录 2.复制ckfinder目录至站点根目录下(可另选择路径) 三.ckfinder应用 1.与ckeditor集成,详情见官方文档,官方文档是加载修改,我用的方法是全局修改. 具体操作方法如下:修改ckeditor目录下的config.js文件,添加: config.filebrowserBrowseUrl = '/ckfinder/ckfinder.html'; config.filebrowserImageBrowseUrl = '/ckfinder/ckfinder.html?Type=Images'; config.filebrowserFlashBrowseUrl = '/ckfinder/ckfinder.html?Type=Flash'; config.filebrowserUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files'; config.filebrowserImageUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images'; config.filebrowserFlashUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'; config.filebrowserWindowWidth = '800'; config.filebrowserWindowHeight = '500'; 以上URL值需要根据你ckfinder路径的不同而不同, 2.单独应用 3.破解: 打开core/js下的两个ckfinder_ie.js和ckfinder_gecko.js文件.查找字符串"en.call(window,qo);"将其注释即可 ----------------------------------------------- 上传路径地址修改 1. 打开 " \ckfinder\config.ascx ",为SetConfig方法中的 BaseUrl 指定默认路径,如: // 以userfiles 为默认路径,其目录下会自动生成images、flash等子目录。 BaseUrl = " ~/ckfinder/userfiles/"; // NOTE:注意“ ~/ ”。 详细出处参考:http://www.jb51.net/article/21907.htm 2、设置生成缩略图 引用内容 Thumbnails.Url = BaseUrl + "_thumbs/"; Thumbnails.Dir = ""; Thumbnails.Enabled = true; Thumbnails.MaxWidth = 100; Thumbnails.MaxHeight = 100; Thumbnails.Quality = 80;
textbox ID="txt" runat="server" TextMode="MultiLine" Width="100%" Height="609">textbox>

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧