Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,262 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,194 people online right now. Registration is fast and FREE... Join Now!




links between forms

 
Reply to this topicStart new topic

links between forms, link between a form and specific element in another form

micaelita
14 Oct, 2008 - 02:52 AM
Post #1

New D.I.C Head
*

Joined: 10 Sep, 2008
Posts: 4

Hello,

I'm wondering if it is possible to link from one form to a specific element in another form, much like in HTML where you can use anchor tags on a page to take the user to a specific part of the page, not just the top. Some of my forms are going to be long for a specific reason and I'd like to be able to direct the user through a link to the relevant part of another form.

So say I have a linklabel in Form1 how can I get it to take the user exactly to Form2.TextBox2 and not just the top of Form2?

I've figured out a workaround to use a 'back to top' link for the long forms, it's just basically reloading the form the user is already on, which may seem a bit redundant but it works.

CODE
Private Sub lblTop_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linklblTop.LinkClicked
        Dim top As New frmAfrica
        top.Show()
        Me.Hide()

    End Sub


However the solution to the other problem still eludes me.
Any suggestions would be much appreciated.

Thanks,

micaelita
User is offlineProfile CardPM
+Quote Post

Bort
RE: Links Between Forms
14 Oct, 2008 - 04:36 AM
Post #2

D.I.C Regular
Group Icon

Joined: 18 Sep, 2006
Posts: 418



Thanked: 4 times
Dream Kudos: 350
My Contributions
I think I get what you mean. Try this:

CODE

Private Sub lblTop_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linklblTop.LinkClicked
        Dim top As New frmAfrica
        top.Show()
        Me.Hide()
        top.TextBox2.Focus()

    End Sub


Hope this helps,
Bort

This post has been edited by Bort: 14 Oct, 2008 - 04:36 AM
User is online!Profile CardPM
+Quote Post

micaelita
RE: Links Between Forms
14 Oct, 2008 - 04:41 AM
Post #3

New D.I.C Head
*

Joined: 10 Sep, 2008
Posts: 4

Completely brilliant. It works a treat. Thankyou so much, Bort.

All the best,

micaelita
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 04:38AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month