1
A
回答
3
这是我会怎么做。
Dim linkLa As New LinkLabel
linkLa.LinkColor = Color.Red
Dim link As LinkLabel.Link = linkLa.Links.Add(0, 13, "http://www.stackoverflow.com")
linkLa.Text = "Stackoverflow"
AddHandler linkLa.LinkClicked, AddressOf Link_Clicked
richTextBox1.Controls.Add(linkLa)
Private Sub Link_Clicked(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("clicked")
End Sub
+0
我接受你的答案,但我想显示的链接地址。 – Sopolin 2009-07-21 06:22:36
0
我有一个答案给你。这将允许您显示链接目标地址作为工具提示。 (几乎没有泡沫。)除此之外,它与斯坦R.的答案类似。
- 将这个代码下的“添加链接”按钮(或任何你要调用它)在你的程序
注:我把每行注释之前,所以它更容易执行!
'define the text and link targets
Dim linktext As String = LinkTextbox.Text 'LinkTextbox is just the textbox where the user inputs the text of the link
Dim linktarget As String = LinkTargetTextbox.Text 'LinkTargetTextBox is just the textbox where the user inputs the target URL of the link
'Define the LinkLabel
Dim lnk As New LinkLabel
'if you want, you can set the different properties, like font or linkcolor, programmatically after defining the linklabel, for instance:
lnk.LinkColor = Color.Blue
'set tooltip
lnk.Tooltip = linktarget
'set the link target
Dim lk As LinkLabel.Link = lnk.Links.Add(0, 13, linktarget)
'set the link text
lnk.Text = linktext
'EventHandler
AddHandler lnk.LinkClicked, AddressOf LinkClicked
'Add the control to the richtextbox
RichTextBox1.Controls.Add(lnk)
'This is the Subroutine that the label will run when clicked (Make sure to put your "End Sub" before this, because it's not part of the button's subroutine)
Private Sub LinkClicked(ByVal sender As Object, ByVal e As EventArgs)
'send link to the browser
Process.Start(linktarget)
End Sub
相关问题
- 1. Richtextbox库
- 2. RichTextBox CtrlI
- 3. RichTextBox的字体
- 4. backcolor只读richtextbox
- 5. Richtextbox Lines.Length == -1
- 6. .NET RichTextBox撤消
- 7. richtextbox行号列
- 8. 打印RichTextBox的
- 9. WPF Richtextbox FontFace/FontSize
- 10. Dumb RichTextBox问题
- 11. WPF RichTextBox和'\ t'
- 12. 不能RichTextBox中
- 13. RichTextBox虚空色
- 14. richtextbox在vb.net
- 15. Richtextbox行数
- 16. RichTextBox默认值?
- 17. 不能RichTextBox的
- 18. 获取RichTextBox的
- 19. Silverlight RichTextBox和UIElementCollection
- 20. RichTextBox颜色
- 21. 寻找在RichTextBox
- 22. WPF RichTextBox ApplyPropertyValue
- 23. RichTextBox滚动
- 24. WPF RichTextBox GetCharacterRect
- 25. WPF RichTextBox RTL
- 26. RichTextbox MaxLength太小
- 27. WPF richTextBox问题
- 28. 在RichTextBox的
- 29. c#richtextbox outofmemory
- 30. C#.NET RichTextBox GetCharOffsetFromPosition?
有这么多免费的编辑们那里只是检查这些 的FCKeditor的一个google一下 – Nagu 2009-07-21 03:53:39