You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Picture/Icon/Folderitem Icon Example
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
dim f as folderItem
f=getopenFolderItem("special/any")
if f<>Nil then
file=f
Refresh
end if
End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action()
file=nil
backdrop=nil
refresh
End EventHandler
End Control
EventHandler Sub Paint(g As Graphics)
dim p as Picture
if file<>nil then
// get icon image and mask
p=file.IconMBS(Width)
if p<>Nil then
g.DrawPicture p,0,0
end if
end if
End EventHandler
EventHandler Sub Resized()
Refresh
End EventHandler
EventHandler Sub Resizing()
Refresh
End EventHandler
Property file As folderItem
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class