|
-
Oct 26th, 2006, 04:24 PM
#1
Thread Starter
New Member
HiperLink in RichTextBox with Dinamyc Code ???
Hello
I need your help, how i can embed a Hiperlink or a button like heperlink in a RichTextBox ???
The RichTextBox must open a PDF File, the Hiperlink or Button must be generated in a exact location of a text in a RichTextBox.
Other cuestion :
Can i justify the text in a RichTextBox ???
Thanks a lot
-
Oct 26th, 2006, 04:32 PM
#2
Re: HiperLink in RichTextBox with Dinamyc Code ???
RichTextBox's can be very fun if you know what you're doing. I've had all sorts of colors and ASCII pictures in one RTB.
As for the hyperlinks, I'm not completely sure. I'm thinking it'll have to be shelled to launch your PDF, but I couldn't help you on launching it from a text box.
-
Oct 26th, 2006, 04:46 PM
#3
Re: HiperLink in RichTextBox with Dinamyc Code ???
to justify text:
VB Code:
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal HWND As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal HWND As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_USER = &H400
Const EM_SETTYPOGRAPHYOPTIONS = WM_USER + 202
Const TO_ADVANCEDTYPOGRAPHY = 1
Const EM_SETPARAFORMAT = WM_USER + 71
Private Const PFA_LEFT = 1
Private Const PFA_RIGHT = 2
Private Const PFA_CENTER = 3
Private Const PFA_JUSTIFY = &H4
Const MAX_TAB_STOPS = 32
Private Type PARAFORMAT2
cbSize As Long
dwMask As Long
wNumbering As Integer
wEffects As Integer
dxStartIndent As Long
dxRightIndent As Long
dxOffset As Long
wAlignment As Integer
cTabCount As Integer
rgxTabs(MAX_TAB_STOPS - 1) As Long
dySpaceBefore As Long
dySpaceAfter As Long
dyLineSpacing As Long
sStyle As Integer
bLineSpacingRule As Byte
bOutlineLevel As Byte
wShadingWeight As Integer
wShadingStyle As Integer
wNumberingStart As Integer
wNumberingStyle As Integer
wNumberingTab As Integer
wBorderSpace As Integer
wBorderWidth As Integer
wBorders As Integer
End Type
Public Enum ERECParagraphAlignmentConstants
ercParaLeft = PFA_LEFT
ercParaCentre = PFA_CENTER
ercParaRight = PFA_RIGHT
ercParaJustify = PFA_JUSTIFY
End Enum
Private Const PFM_ALIGNMENT = &H8&
Private Function SetAlignment(lHwnd As Long, ByVal eAlign As ERECParagraphAlignmentConstants)
Dim tP2 As PARAFORMAT2
Dim lR As Long
tP2.dwMask = PFM_ALIGNMENT
tP2.cbSize = Len(tP2)
tP2.wAlignment = eAlign
lR = SendMessageLong(lHwnd, EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY, TO_ADVANCEDTYPOGRAPHY)
lR = SendMessage(lHwnd, EM_SETPARAFORMAT, 0, tP2)
End Function
Private Sub Form_Load()
SetAlignment RichTextBox1.HWND, ercParaJustify
End Sub
I am not sure if RTB can read PDF files, but if you know how to do it, you have to make RTB detect hyperlinks. Check Moeur's RTB tips and tricks - AutoDetect and Respond to URLs
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
|