In the following code I have an OpenFile() Function which opens a fileDialogBox, I then select my file (which will be a PDF) and return it back. My question is....When I get the filename and path, is there a way to take this path and put it into a textbox or richtextbox as a hyperlink? I want the user to be able to view the file once it has been selected and displayed on the form. But when I tried the following:
It said the "insertLink" was not a member of richtextbox. But i see examples of it all over the net.
Here is the code I have so far just passing the string to the textbox and richtextbox, I just need it to be passed as a hyperlink to the file location.
Code:
Private Sub btnOpenFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAttachDoc.Click
'declare a string to the filename
Dim strFileNameAndPath As String = Open File()
If (strFileNameAndPath = "") Then
MsgBox("You did not select a file!")
Else
'Pass filename to textbox and richtextbox for testing
tbAttachment.Text = (System.IO.Path.GetFileName(strFileNameAndPath))
tbAttachment.Text = (System.IO.Path.GetFileName(strFileNameAndPath))
End If
End Sub
I appreciate your willingness to help, but I was unable to open up any of the forms and vb code you sent. I mean, after all....This really is just for looks and to allow the user to double check what they have posted in a file, not really needed. If I can't find anything else on it in the next day or so, i'll probably just forget it. I was looking into LinkLabel's, but then I ran into the problem of "getting" the filepath and filename from my filedialogbox over to the click function of the label. Oh well
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.