如题
谢谢~~~
谢谢~~~
解决方案 »
- 菜鸟求助,后台值前台取不出来!!!
- 在ListView1中,在操作中,客户用可以是点击ListView的行,获取行信息 会触发listView1_Click事件,可是客户也可能是用上下键移动选择的
- vs2005连接sybase数据库的方法
- 急急急!!!
- combobox绑定一个dataTable,想在运行时设置combobox显示指定的一项,可是设置seletedtext,selectedindex,text,selectedvalue都没用?
- C#对Oracle数据库的操作出现问题,请各位兄弟帮忙看一下!
- 请问怎么样在两个窗体之间调用Click的方法
- C#winFrom应用程序的启动的问题
- 留下你的MSN,一起交流,一起学习(没有MSN的留QQ也行)
- C# invoke 线程回调 问题求教
- FORM一设置成MDI子窗体,一显示就自动最大化,怎么回事?
- 关于 PostMessage 函数的问题
该数组中的每个元素成为文本框控件中的一行文本。如果文本框控件的 Multiline 属性设置为 true,并且文本中出现换行符,则换行符后的文本被添加到该数组的一个新元素中,并显示在另一行上。实例:
public void ViewMyTextBoxContents()
{
// Create a string array and store the contents of the Lines property.
string[] tempArray = new string [textBox1.Lines.Length];
tempArray = textBox1.Lines;
// Loop through the array and send the contents of the array to debug window.
for(int counter=0; counter < tempArray.Length;counter++)
{
System.Diagnostics.Debug.WriteLine(tempArray[counter]);
}
}
[DllImport("User32.DLL")]
public static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int iParam); private const int EM_LINEFROMCHAR = 0xC9;
private const int EM_LINEINDEX = 0xBB; private void button6_Click(object sender, EventArgs e)
{
int Y = SendMessage(textBox1.Handle, EM_LINEFROMCHAR, textBox1.SelectionStart, 0);
string S = textBox1.Lines[Y];
int X = SendMessage(textBox1.Handle, EM_LINEINDEX, Y, 0);
textBox1.SelectionStart = X;
textBox1.SelectionLength = S.Length;
textBox1.Focus; Text = string.Format("当前光标停留在{0}行,本行的文字是{1}", Y, S);
}