home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
code
/
design
/
toolba
/
toolbar.frm
< prev
next >
Wrap
Text File
|
1995-02-14
|
3KB
|
107 lines
VERSION 2.00
Begin Form Form1
Caption = "Simple Toolbar"
ClientHeight = 3870
ClientLeft = 1155
ClientTop = 1725
ClientWidth = 7425
Height = 4590
Left = 1080
LinkTopic = "Form1"
ScaleHeight = 3870
ScaleWidth = 7425
Top = 1080
Width = 7575
Begin PictureBox PictBitmaps
AutoRedraw = -1 'True
AutoSize = -1 'True
Height = 1350
Left = 90
Picture = TOOLBAR.FRX:0000
ScaleHeight = 1320
ScaleWidth = 3600
TabIndex = 1
Top = 540
Visible = 0 'False
Width = 3630
End
Begin PictureBox PictToolBar
Align = 1 'Align Top
AutoRedraw = -1 'True
BackColor = &H00C0C0C0&
Height = 495
Left = 0
ScaleHeight = 465
ScaleWidth = 7395
TabIndex = 0
Top = 0
Width = 7425
End
Begin Menu MnuMain
Caption = "&Toolbar"
Begin Menu MnuSub
Caption = "&Add Button (Do it again)"
Index = 1
End
Begin Menu MnuSub
Caption = "&Remove Button 2"
Index = 2
End
Begin Menu MnuSub
Caption = "&Gray Button 3"
Index = 3
End
Begin Menu MnuSub
Caption = "-"
Index = 98
End
Begin Menu MnuSub
Caption = "&Exit"
Index = 99
End
End
End
Option Explicit
Dim ToolBarButtons() As ToolbarButtonType
Sub Form_Load ()
PictToolBar.ScaleMode = 3 ' Pixel
PictToolBar.ScaleHeight = 28 ' Hoehe der Toolbar
ReDim ToolBarButtons(0)
End Sub
Sub MnuSub_Click (index As Integer)
On Error Resume Next
Select Case index
Case 1
Dim ToolBarsCount As Integer
ToolBarsCount = UBound(ToolBarButtons) + 1
ReDim Preserve ToolBarButtons(ToolBarsCount)
ToolbarAddButton PictToolBar, ToolBarButtons(ToolBarsCount), ToolBarsCount * 24, ToolBarsCount, PictBitmaps
Case 2
ToolBarHideButton PictToolBar, ToolBarButtons(2), PictBitmaps
Case 3
ToolBarGrayButton PictToolBar, ToolBarButtons(3), PictBitmaps
Case Else
Unload Me
End Select
End Sub
Sub PictToolBar_Click ()
'
'
'
Dim ButtonNr As Integer
ButtonNr = ToolBarGetClicked(PictToolBar, ToolBarButtons())
If ButtonNr > 0 Then MsgBox "Hi, there was then " + Str(ButtonNr) + " Button Clicked)"
End Sub
Sub PictToolBar_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
ToolBarMousedown PictToolBar, ToolBarButtons(), x, y, PictBitmaps
End Sub
Sub PictToolBar_MouseUp (Button As Integer, Shift As Integer, x As Single, y As Single)
ToolBarMouseUp PictToolBar, ToolBarButtons(), x, y, PictBitmaps
End Sub