以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- WinForm.TextBox怎么在光标处插入文本? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=188828) |
-- 作者:xluoping -- 发布时间:2023/10/22 15:26:00 -- WinForm.TextBox怎么在光标处插入文本? Dim te As WinForm.TextBox = e.Form.Controls("TextBox1") te 的文本为 ABCDEFG,将光标停在DE之间, 想设置一个按钮,点击 时,在DE间插入[客户名],如何实现? |
-- 作者:有点蓝 -- 发布时间:2023/10/22 20:29:00 -- 窗口afterload事件 Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1") Dim d = txt.BaseControl d.HideSelection = False 按钮 Dim t As WinForm.TextBox = e.Form.Controls("TextBox1") t.text = t.text.insert(t.SelectionStart,"客户名") |