|
-
Jan 5th, 2005, 10:37 PM
#1
Thread Starter
Member
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.
-
Jan 6th, 2005, 07:21 AM
#2
Hyperactive Member
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
-
Jan 6th, 2005, 07:32 AM
#3
Thread Starter
Member
Re: links
Well I kind of already knew that. I just don’t know how I do it, like the syntax
-
Jan 6th, 2005, 07:59 AM
#4
Hyperactive Member
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!
-
Jan 6th, 2005, 08:55 AM
#5
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:
Dim DirInfo As New IO.DirectoryInfo("[i]path to links folder[/i]")
For Each File As IO.FileInfo In DirInfo.GetFiles("*.url")'Loops through all the links in the folder
'Create your buttons here
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)
-
Jan 6th, 2005, 02:46 PM
#6
Thread Starter
Member
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)
-
Jan 6th, 2005, 08:33 PM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|