Results 1 to 7 of 7

Thread: links

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2005
    Location
    Minnesota
    Posts
    46

    Resolved links

    Hello,
    I am trying to add a toolbar to a web browser like the links on IE. I know I need to some how add the files in the links folder to the tool bar. I know I will need a for loop, but me being a beginner that is all I know. I am using VB.net 2003.

    Thanks for any help in advance.
    Last edited by tonyrueb; Jan 7th, 2005 at 04:24 PM.

  2. #2
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    263

    Re: links

    Hi

    Your gonna need to create buttons dynamically to the toolbar dependant on the Links Folder.

    There is a sample of how to loop files on this forum somewhere couldn't find that, but that will give you the names of the buttons using the file names.

    Then you just need to create buttons for each file on the toolbar.

    Hope this points you in the right direction, have a go and see where you get too.

    danny

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2005
    Location
    Minnesota
    Posts
    46

    Re: links

    Well I kind of already knew that. I just don’t know how I do it, like the syntax

  4. #4
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    263

    Re: links

    You'll learn nothing if you don't try, you have the method now do the code!

    Not gonna write it for you, thats no good at all.

    Danny

    PS If you have tried paste the code!

  5. #5
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718

    Re: links

    Use the DirectoryInfo class to get a list of all the files in a folder and you can then loop through them all using a For .. Each loop.

    For instance:
    VB Code:
    1. Dim DirInfo As New IO.DirectoryInfo("[i]path to links folder[/i]")
    2.  
    3. For Each File As IO.FileInfo In DirInfo.GetFiles("*.url")'Loops through all the links in the folder
    4.     'Create your buttons here
    5. Loop
    That'll get all the link files for you, but you'll still need the code to create the buttons and stuff dynamically. I'd suggest putting the code for adding the buttons in a separate subroutine, accepting the file as the argument to create the button. Sorry I can't provide that for you.
    Last edited by Ideas Man; Jan 6th, 2005 at 08:58 AM.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

  6. #6

    Thread Starter
    Member
    Join Date
    Jan 2005
    Location
    Minnesota
    Posts
    46

    Re: links

    Thank you all I needed to know is how to get the for loop, so inside the for loop I put some thing like tbLinks.addbutton () or what ever the command is? (I’m not on a computer with VB)

  7. #7
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718

    Re: links

    Yeah, although like I said, that's better handled in a separate procedure than inside the loop, passing the File that's used in the loop. I'm unsure how to create buttons dynamically and associate handlers etc. for it, so I can't help you there cause I've never had to do it before.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width