Hi Fangles
As a start
# 1
Code:
If OpenWindow(1,300,400,200,60,"Toolbarproblem",#PB_Window_SystemMenu)
TB = CreateToolBar(1,WindowID(1))
ToolBarStandardButton(0, #PB_ToolBarIcon_New)
ToolBarSeparator()
ToolBarStandardButton(1, #PB_ToolBarIcon_Cut,#PB_ToolBar_Toggle)
ToolBarSeparator()
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Menu
Select EventMenu()
Case 1
If Run = 1
SendMessage_(TB,#TB_CHANGEBITMAP,1,1)
Else
SendMessage_(TB,#TB_CHANGEBITMAP,1,3)
EndIf
Run = Run ! 1
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
EndIf
End
# 2
Code:
Dim Img(2)
For x=0 To 2
CreateImage(x,16,16)
Next
StartDrawing(ImageOutput(0))
Box(0, 0, 16,16,$0779F8)
StopDrawing()
StartDrawing(ImageOutput(1))
Box(0, 0, 16,16,$0103FE)
StopDrawing()
StartDrawing(ImageOutput(2))
Box(0, 0, 16,16,$FC0203)
StopDrawing()
If OpenWindow(0,300,400,200,60,"Toolbar Images",#PB_Window_SystemMenu)
TB = CreateToolBar(0,WindowID(0))
For x=0 To 2
ToolBarImageButton(x,ImageID(x))
Next
Img(0)=SendMessage_(TB,#TB_GETBITMAP,1,0)
Img(1)=SendMessage_(TB,#TB_GETBITMAP,2,0)
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Menu
Select EventMenu()
Case 1
If Run = 1
SendMessage_(TB,#TB_CHANGEBITMAP,1,Img(0))
Else
SendMessage_(TB,#TB_CHANGEBITMAP,1,Img(1))
EndIf
Run = Run ! 1
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
EndIf
End