Page 1 of 2

Application Bar Update - Folders/Harddrives

Posted: Wed Aug 05, 2009 4:08 am
by CodenStuff
Hello,


A tiny update for the Application Bar now. This one will give you the ability to add folders and harddrives to your bar where as the previous versions had problems doing this.

You need to first add 2 embedded files to the project which will be *.ico files named the following:

1. Folder.ico
2. Harddrive.ico

You can choose your own icon images to match your windows theme or you can use these ones. Image..Image ..right-click and save image to your harddrive they wont look grainy I promise.

Once you have added those to the project you need to find the code below and change it as listed:

Find:
Code: Select all
 Catch ex As Exception
                        Using ico As Icon = Drawing.Icon.ExtractAssociatedIcon(line)
                            Dim s = ico.ToBitmap
                            w.Image = s
                        End Using
                    End Try
Change it to this:
Code: Select all
Catch ex As Exception
                        Try
                            Using ico As Icon = Drawing.Icon.ExtractAssociatedIcon(line)
                                Dim s = ico.ToBitmap
                                w.Image = s
                            End Using
                        Catch wex As Exception
                            If line.Length = 3 Then

                                Using ico As Icon = My.Resources.Harddrive
                                    Dim s = ico.ToBitmap
                                    w.Image = s
                                End Using
                            Else
                                Using ico As Icon = My.Resources.Folder
                                    Dim s = ico.ToBitmap
                                    w.Image = s
                                End Using
                            End If
                        End Try
                    End Try
Find:
Code: Select all
 Catch ex As Exception
                    Using ico As Icon = Drawing.Icon.ExtractAssociatedIcon(filename)
                        Dim s = ico.ToBitmap
                        w.Image = s
                    End Using
                End Try
Change to this:
Code: Select all
Catch ex As Exception
                        Try
                            Using ico As Icon = Drawing.Icon.ExtractAssociatedIcon(filename)
                                Dim s = ico.ToBitmap
                                w.Image = s
                            End Using
                        Catch wex As Exception
                            If filename.Length = 4 Then
                                Using ico As Icon = My.Resources.Harddrive
                                    Dim s = ico.ToBitmap
                                    w.Image = s
                                End Using
                            End If
                            Using ico As Icon = My.Resources.Folder
                                Dim s = ico.ToBitmap
                                w.Image = s
                            End Using
                        End Try
                    End Try
Thats it :D all done. You should now be able add folders and harddrives to the bar without problems.

Need any help please ask.

Re: Application Bar Update - Folders/Harddrives

Posted: Fri Sep 18, 2009 5:41 pm
by CodemaN
thnxxx.....!!!!

Re: Application Bar Update - Folders/Harddrives

Posted: Sun Oct 11, 2009 1:01 pm
by Neki
Thanks, and great choice of icons!

Re: Application Bar Update - Folders/Harddrives

Posted: Sun Oct 11, 2009 1:45 pm
by Nery
Well if you keep like this you'll turn it in an application better then RocketDock :D

Re: Application Bar Update - Folders/Harddrives

Posted: Sun Oct 11, 2009 1:48 pm
by Neki
That's true. :)

Re: Application Bar Update - Folders/Harddrives

Posted: Fri Jun 04, 2010 6:48 pm
by bfh13
it works on folders but not harddrive

Re: Application Bar Update - Folders/Harddrives

Posted: Tue Aug 11, 2015 12:53 am
by Fede1591
hello, I do not work , I get error:
My.Resources.Harddrive
My.Resources.Folder

" System.Drawing.Bitmap a value of type can not be converted into system.drawing.icon "

Re: Application Bar Update - Folders/Harddrives

Posted: Fri Aug 14, 2015 12:04 pm
by CodenStuff
Fede1591 wrote:
hello, I do not work , I get error:
My.Resources.Harddrive
My.Resources.Folder

" System.Drawing.Bitmap a value of type can not be converted into system.drawing.icon "
Did you use the images from this tutorial or your own?

Make sure they are .ico type files and not bitmaps or jpgs etc.

Re: Application Bar Update - Folders/Harddrives

Posted: Fri Aug 14, 2015 5:49 pm
by Fede1591
hello, and tested and follow me out the error:
" System.Drawing.Bitmap a value of type can not be converted into system.drawing.icon "

You could upload the file ?
thank you

Re: Application Bar Update - Folders/Harddrives

Posted: Sat Aug 15, 2015 12:56 pm
by CodenStuff
The images are in the first post:

Image

Image

You can just Right-Click and save as to your computer.