Call TextBox1_Leave中(javamailsenderimpl, e)是什么意思

中国领先的IT技术网站
51CTO旗下网站
C# TextBox滚动实现解析
我们在C# TextBox操作的时候实现C# TextBox滚动的具体操作是什么呢?在C# TextBox使用的时候需要注意什么呢?那么本文就向你介绍这些具体内容。
作者:huang_ying_lu来源:网易博客| 13:18
C# TextBox滚动实现具体的内容是什么?使用C# TextBox时需要注意什么呢?作为我们编程的实现C# TextBox滚动的操作细节是什么呢?那么下面我们来看看具体的C# TextBox滚动的操作实现以及C# TextBox使用需要注意的问题。
C# TextBox滚动实例代码:using&S &using&System.Collections.G &using&ponentM &using&System.D &using&System.D &using&System.T &using&System.Windows.F &using&System.Runtime.InteropS &namespace&WindowsApplication27 &...{ &///&&summary& &&&&&public&partial&class&Form1&:&Form &...{ &public&Form1() &...{ &InitializeComponent(); &&this.textBox1.Clear(); &for&(int&i&=&0;&i&&=&20;i++&) &...{ &this.textBox1.Text&+=&string.Format("{0}:jinjazz__{1}&",&i,i); &} &this.timer1.Interval&=&200; &this.timer1.Start(); &} &&&[DllImport("user32.dll",&EntryPoint&=&"SendMessage")] &public&static&extern&int&SendMessage( &IntPtr&hWnd,&int&wMsg,&int&wParam,&int&lParam); &&[DllImport("user32")] &public&static&extern&int&GetScrollPos(IntPtr&hwnd,&int&nBar); &&[DllImport("user32.dll")] &static&extern&int&SetScrollPos(IntPtr&hWnd,&int&nBar, &&&&int&nPos,&bool&bRedraw); &&public&const&int&EM_LINESCROLL&=&0xb6; && &private&void&timer1_Tick(object&sender,&EventArgs&e) &...{ &int&i=&&GetScrollPos(this.textBox1.Handle,1); &&&SendMessage(this.textBox1.Handle,& &EM_LINESCROLL,&0,&1);&&&if&(i&==&GetScrollPos(this.textBox1.Handle,&1)) &...{ &&&this.textBox1.SelectionStart&=&0; &this.textBox1.SelectionLength&=&1; &this.textBox1.ScrollToCaret(); &this.textBox1.SelectionLength&=&0; &} &Console.WriteLine(i); &} &&private&void&textBox1_MouseEnter( &object&sender,&EventArgs&e) &...{ &this.timer1.Stop(); &} &&private&void&textBox1_MouseLeave( &object&sender,&EventArgs&e) &...{ &this.timer1.Start(); &} &} &} &
C# TextBox使用是要注意:
1、如何在多行TextBox中写入文本时实现换行:由于Windows系统中,回车符需两上字符。因此方法是使用\r\n标记,如Label="Calculation&"+":.......SUM\r\n"; &textBox.AppendText(Label);&
另外还有一个办法是用Environment.Newline的方法,可以兼容Windows和Linux系统。
2、如何在多行TextBox中用滚动条,使添加文本后自动滚动显示到最后一行:方法是使用ScrollToCaret方法,自动滚动到插入符的位置,如:textBox.AppendText(Label); &textBox.ScrollToCaret();&
C# TextBox滚动的实现以及C# TextBox使用时需要注意的基本内容就向你介绍到这里,希望对你了解和学习C# TextBox滚动、换行等等有所帮助。
【编辑推荐】
【责任编辑: TEL:(010)】
大家都在看猜你喜欢
原创原创原创热点头条
24H热文一周话题本月最赞
讲师:112718人学习过
讲师:83451人学习过
讲师:12217人学习过
精选博文论坛热帖下载排行
它从最简单的地方入手,不仅讲述了JavaScript的基础知识,还讲述了JavsScript如何操作CSS、DOM等Ajax基础技术。而关于跨浏览器兼容问题的解...
订阅51CTO邮刊有关TextBox中输入字符控制的一种解决办法有关TextBox中输入字符控制的一种解决办法我们知道,在C#中,TextBox控件对输入字符的控制有keypress、keyup、和keydown事件来使用,但大家也看到了,这几个事件对输入字符的控制都有一定的缺陷,如果,你使用中文输入法,那么很多原来你不希望输入的字符也可以输入进去。这几天做程序的时候,就碰到了这个问题,我的解决思路很简单,既然这三个事件不再起作用,那么我就使用了TextBox控件中时刻能发生的TextChanged事件,以期望在这个事件中作些东西,以达到控制字符的目的。废话就不多说了,我将控制输入字符为数字的代码粘贴出来,希望大家多指正,如果能对你有益的话,我就更happy了。&private System.Windows.Forms.TextBox textBox1;public Form1(){&& text = textBox1.T}private void textBox1_TextChanged(object sender, System.EventArgs e){&&& int len = text.Lif(len & textBox1.Text.Length){&&&&&& int index = textBox1.Text.IndexOf(text);&&&&&& char c = (textBox1.Text.Remove(index,text.Length))[0];&&&&&& pareTo('0') & 0||c.CompareTo('9') &0)&&&&&& {&&&&&&&&&& textBox1.Text =&&&&&&&&&& textBox1.SelectionStart = text.L&&&&&&}&&&&}&&& text = textBox1.T&&&&&&&&&& }&安全检查中...
请打开浏览器的javascript,然后刷新浏览器
< 浏览器安全检查中...
还剩 5 秒&温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(1700)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_095071',
blogTitle:'vb.net textbox控件 限制输入的一些实用方法.',
blogAbstract:'编制计算类程序时文本框一般都用于输入数字数据,此时可以通过以下步骤来确保用户输入数据的正确性:
首先添加好文本框控件TextBox后把属性IMEMode的值改成Disable,这样在该文本框中就不能使用中文输入法了。然后对文本框的KeyPress事件添加以下代码Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Textbox1.KeyPress&&& If Char.IsDigit(e.KeyChar) Or e.KeyChar = Chr(8) Then',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:9,
permalink:'blog/static/',
commentCount:1,
mainCommentCount:1,
recommendCount:1,
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:'1',
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}}

我要回帖

更多关于 e.sender 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信