专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »VB教程 » richtext:Adding Hyperlink Capability to RichText Boxes-vb教程 »正文

richtext:Adding Hyperlink Capability to RichText Boxes-vb教程

来源: 发布时间:星期四, 2009年2月12日 浏览:156次 评论:0


Adding Hyperlink Capability to RichText Boxes

This tip show how to add hyperlinks o a RichTextBox. What you need to create is two es that will eract with the RichTextBox.

The two es are CHyperlink and CHyperlinks.

CHyperlink

CHyperLink is a simple Class that describes a hyperLink and has a method to open the URL it pos to.

Properties:

  • LinkUrl
  • LinkText
Methods:

  • OpenLink
The LinkUrl property is a containing the URL (for example: http://www.microsoft.com).

The LinkText property is a containing the text shown in the RTF box (Click here to go to Microsoft).

The OpenLink methods use the ShellExecute API function to launch the default webbrowser and passes the URL to it.

CHyperLinks

CHyperLinks is a collection . It contains a collection of CHyperLink objects. When you develop an application you _disibledevent=>The Add method will add a CHyperLink object to the collection AND add the text \"Go to VB-World\" to the RichTextBox1 object. This text will be underlined and in the colour blue.

When you click _disibledevent=>
Completed Hyperlink Demo Project

I have that show you how to use the es. It is written in VB5. The zip file also s two text files that contain the code of two es that you can just cut and paste you´re not able to open the project.

Tip by


0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: