Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox and Hyperlink

Status
Not open for further replies.

tsunami100

Programmer
Jan 2, 2005
39
NL
I have a form with a bindingnavigator (I'm using Visual studio 2005)
So when the user clicks on the "Add New" icon he can fill in a hyperlink into a textbox.
Later when he navigates through those records the textbox shows the hyperlink but it's not blue, what i mean the hyperlink does not redirect the user to the requested webpage.
Is there another control or should i change the textbox into a linklabel ?

Thanks


I choose my username Tsunami because i hope it keeps everybody remembering this terrible disaster.
 
Redirect the user to the page in your TextBox Click event procedure.
 
How about the RichTextBox control.

Then use the LinkClicked event to fire off the hyperlink.
 
Hi,

Thanks for your replies !!
I can redirect by using the TextBox Click event but i want the text to appear as a link.
When i use a RichTextBox control, i can't change the borderstyle in a way so that all controls look the same.
And that's what i want !!!


I choose my username Tsunami because i hope it keeps everybody remembering this terrible disaster.
 
What kind of border style do you want to apply to it?
 
I don't know what exactly is going on but the borderstyle of all my textboxcontrols are set to Fixed3D.
They all have a white background with a thin blue line as border. It doesn't look like 3D to me.
I can't change the RichTextBox to that.
The RichTextBox is really 3D just like the controls in the older versions of VB.


I choose my username Tsunami because i hope it keeps everybody remembering this terrible disaster.
 
Interesting...

Here is a screenshot of a test app I threw together:
If the TextBoxControls are set to Fixed3D then they should be looking like the top textbox.

The lower textbox is what you seem to be describing. You can "build your own" border for textboxes by setting their BorderStyle to None, and putting a label with a different backcolor behind it. In this case my Labels backcolor was blue and I made sure that the RichTextBox was 2 pixels smaller than the label in height and width, and offcenter of the label by 1 pixel on the top and bottom. This achieved the 1 pixel border look of a different color.
 
Thank you very much,
I have to try it out but i have to go now.
I hope i can talk to you later !!!!
Another question : when i click on a link it doesn't redirect the user to the requested link

I choose my username Tsunami because i hope it keeps everybody remembering this terrible disaster.
 
No problem...

To redirect the link you need to trap the LinkClicked event from the RichTextBox - here is a simple example:

Code:
Private Sub RichTextBox1_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) Handles RichTextBox1.LinkClicked
    System.Diagnostics.Process.Start(e.LinkText)
End Sub
 
Borvik,
That's all i'm looking for.
Thank you so much !!!!!
Another thing,
I know VB for several years and when i see some code, i always understand that
But many times i don't know how to start when i have to write an app by myself.
The .NET Framework is so big, is it normal i don't understand all of it, do you know a place where i can start from the beginning.
As i told you i'm not new to VB but when i need an answer to solve a problem i don't know where to start.
Of course we are very lucky to have people like you.
Thanks again !!!

I choose my username Tsunami because i hope it keeps everybody remembering this terrible disaster.
 
No prob Tsunami,

Well, the .NET Framework is big - but I find the best way to learn it is by example. Usually when I come up against something, I search for an example of something similar to what I need - find out how it works, and adapt it to what I need. For specific examples you can sometimes find code examples in the MSDN library. Another good repository is at - they have lots of code examples, as well as some dandy custom controls written by other community members. And of course if you're really stuck, I find these boards to be rather helpful too.

Good luck with your coding.
 
Borvik,

Thanks again.
Yep, that's what i do.
Looking for examples on the internet and MSDN.
Are you a programmer in real life ?
When you are, is this the way you do it at work ?
Maybe i'm asking to much but i want to become a programmer myself and i want to find out how real programmers solve their problems.
The main issue here is that even when i find it out, i don't know if i'm writing robust code.
Proberly you know this one : This is great stuff !!!!

Thanks Borvik !!

Lode.

I choose my username Tsunami because i hope it keeps everybody remembering this terrible disaster.
 
Yup,

I'm a programmer - a one man team.

And yes, this is pretty much the way I do things, although after a while you retain the stuff and can start playing with and creating your own.

Shoot, and don't let worrying about robust code stop you from trying. I don't even know sometimes if what I have is robust. All I can say is comment, comment, comment your code so you know what your doing when you look back on it - I comment when I can but should do a better job of it, as I am having problems looking back on past code.
 
Borvik,

Well, I've been asking around a little bit and met some people who had installed software developed by softwarecompanies and all of them seem to have troubles with it. None of the apps seems to work the way it should.
Even after several months things are not the way it should be. According to Microsoft developing apps has never been so easy and in a way they're right about this.
But as i told you before i think you cannot being good or even the best in all these things.
Should i focus myself to one specific part because now i know a little bit of everything and that's not helping me reaching my target. When i become let's say
a VB and SQL-server specialist would that give any guarantee for the future ?
What's your opinion ?

I choose my username Tsunami because i hope it keeps everybody remembering this terrible disaster.
 
Database administrators for the most part really sought after. I would go with what you enjoy doing.

I've been programming VB since Jr. High, and went to College for it so I could learn more on the various languages.

I'm now in the field and enjoy it for the most part (except when they think I'm the Network Admin - 2 person IT Team here).

If you enjoy doing it - I'd say go for it - and have fun.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top