|
-
Oct 23rd, 2018, 03:10 AM
#11
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
Thank you softv for your points.
Concerning this point I can say that you should try to set the 'AutoURLDetect' property to False. It's by default to True in the RichTextBox.
Because MSDN says:
Do not set SetAutoURLDetect to TRUE if your edit control uses the CFE_LINK effect for text other than URLs. SetAutoURLDetect enables this effect for URLs and disables it for all other text
Thanks for your prompt reply, as ever, Krool.
The workaround suggested by you does help for Windows10. It works and Thank You so much. 
Well, you must be knowing the following already with regard to Windows7 systems but yet stating it hereunder since, based on the same, I have a question.
In Windows 7, even with AutoURLDetect property set to True, I am able to easily set hyperlinks for our RichTextBox's text containing 100s of absolute URLs (e.g. http://google.com) and named URLs (e.g. "Click here to visit Google"). The AutoURLDetect property (which is set to True) takes care of setting the hyperlinks for the absolute urls, automatically. So, I need to take care of setting the hyperlinks for the named URLs alone, programmatically (using the already mentioned code, which uses CFE_LINK and CFM_LINK).
Based on the above, I have a question for Windows 10 systems.
In Windows 10 (may be in Windows 8 too; I do not have a Windows 8 system), it is clear now that setting 'AutoURLDetect property to False' for our RichTextBox (say rtb1) alone can help me set hyperlinks for named URLs in rtb1's text, when using the 'CFE_LINK and CFM_LINK' method. That being the case, the only way I have now (in Windows 10 systems) to set hyperlinks for all the URLs when rtb1's text contains both named and absolute URLs (in 100s) is:
- Set the AutoURLDetect property of rtb1 to False.
- Set the hyperlinks for the named URLs in rtb1's text, as usual. i.e. set them programmatically (using the already mentioned code, which uses CFE_LINK and CFM_LINK)
- Programmatically detect all the absolute URLs in rtb1's text.
- Set hyperlinks for the detected absolute URLs using the same 'CFE_LINK and CFM_LINK' method, the one used for setting hyperlinks for named URLs.
Is my above approach right? If not, when possible, either you or any other member may kindly let me know the better/easier approach. Thanks.
My hearty thanks and best wishes, at all times, for all your noble deeds, Krool.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|