高分请教:如何得知被鼠标选中的文本是什么? 不可以,我的意思是说,只是选中文本(high light),而后不做任何操作。程序就对所选字符进行处理。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那用timer控件,每隔一定的时间,检查所有能接受用户输入的控件,如果seltext不为空,就操作行吗? 如果是捕获你工程内的,可以使用类似下面的方法private text1_mousemove(button,x,y) if button=vbleftbutton then text2.text=text1.seltext end ifend sub如果是捕获windows的,只能使用api the Seltext method only can be used in textfield, but i am using ricgtextbox, it's no effective in richtextbox. 你的提示很有用,谢谢,但是我使用的是rich text box, 按照你的方法就不可以了。你能告诉我另外的方法吗?谢谢! 这样那Private Sub RichTextBox1_SelChange() MsgBox "选择了"End Sub 如果这样可不可以?Private Sub RichTextBox1_SelChange() 'MsgBox "有了" Dim seltxt As String seltxt = RichTextBox1.SelText MsgBox seltxtEnd Sub 有了你的帮助,选中文本的问题解决了。先放分,感谢大家。有可能的话,你能告诉我鼠标取词怎么做吗?我的email: [email protected] 一个奇怪的问题,高手进 “类型不匹配”的问题 VB API 知多少? 如何截取access中日期/时间字段的年? 用Flashget提供接口做下载程序,怎么用程序控制改变另存到的地址,非常感谢! 怎么学VB啊! 一个控件的顺序问题,大家肯定碰到过! 为什么richbox总是不能出现水平滚动条? 关于ADODB的定义问题? 一个容易忽视但又很重要的问题! 帮帮我吧, 如何使用TabStrip控件? 急急!!!!!!!!!
private text1_mousemove(button,x,y)
if button=vbleftbutton then
text2.text=text1.seltext
end if
end sub
如果是捕获windows的,只能使用api
MsgBox "选择了"
End Sub
Private Sub RichTextBox1_SelChange()
'MsgBox "有了"
Dim seltxt As String
seltxt = RichTextBox1.SelText
MsgBox seltxt
End Sub