frmtest.frm
来自「这是vb的源码 感谢这个网站给大家这个空间」· FRM 代码 · 共 270 行
FRM
270 行
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
Begin VB.Form frmTest
Caption = "Creating a Rebar Control"
ClientHeight = 4170
ClientLeft = 60
ClientTop = 345
ClientWidth = 5385
LinkTopic = "Form1"
ScaleHeight = 278
ScaleMode = 3 'Pixel
ScaleWidth = 359
StartUpPosition = 2 'CenterScreen
Begin ComctlLib.Toolbar tbr
Height = 420
Left = 120
TabIndex = 6
Top = 2400
Width = 3225
_ExtentX = 5689
_ExtentY = 741
ButtonHeight = 635
ImageList = "iml"
_Version = 327680
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 10
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
ImageIndex = 1
EndProperty
BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
ImageIndex = 2
EndProperty
BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
Style = 3
EndProperty
BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
ImageIndex = 3
EndProperty
BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
ImageIndex = 4
EndProperty
BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
ImageIndex = 5
EndProperty
BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
Style = 3
EndProperty
BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
ImageIndex = 6
EndProperty
BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
ImageIndex = 7
EndProperty
BeginProperty Button10 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
ImageIndex = 8
EndProperty
EndProperty
End
Begin VB.CommandButton cmdClear
Caption = "Remove All Bands"
Height = 495
Left = 3120
TabIndex = 9
Top = 1680
Width = 2175
End
Begin VB.PictureBox BGpic
Height = 735
Left = 120
Picture = "frmTest.frx":0000
ScaleHeight = 45
ScaleMode = 3 'Pixel
ScaleWidth = 189
TabIndex = 8
Top = 1560
Width = 2895
End
Begin VB.CommandButton cmdTB
Caption = "Add Toolbar"
Height = 375
Left = 3480
TabIndex = 7
Top = 2400
Width = 1815
End
Begin VB.CommandButton cmdCBO
Caption = "Add Combo"
Height = 315
Left = 4080
TabIndex = 5
Top = 2880
Width = 1215
End
Begin VB.ComboBox cboAddr
Height = 315
Left = 120
TabIndex = 4
Text = "http://www.cyberhighway.com/~psy/"
Top = 2880
Width = 3975
End
Begin VB.TextBox Text1
Height = 285
Left = 120
TabIndex = 3
Text = "TextBand1"
Top = 3240
Width = 3615
End
Begin VB.CommandButton cmdText
Caption = "Add Text Band"
Height = 285
Left = 3720
TabIndex = 2
Top = 3240
Width = 1575
End
Begin VB.CommandButton cmdDestroy
Caption = "Destroy Rebar"
Height = 375
Left = 1920
TabIndex = 1
Top = 3720
Width = 1695
End
Begin VB.CommandButton cmdCreate
Caption = "Create Rebar"
Height = 375
Left = 120
TabIndex = 0
Top = 3720
Width = 1695
End
Begin ComctlLib.ImageList iml
Left = 120
Top = 1560
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 327680
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 8
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmTest.frx":0FF1
Key = ""
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmTest.frx":1103
Key = ""
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmTest.frx":1215
Key = ""
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmTest.frx":1327
Key = ""
EndProperty
BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmTest.frx":1439
Key = ""
EndProperty
BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmTest.frx":154B
Key = ""
EndProperty
BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmTest.frx":165D
Key = ""
EndProperty
BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmTest.frx":176F
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmTest"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCBO_Click()
RBAddBandByhWnd cboAddr.hwnd, "Address", BGpic.Picture.Handle
End Sub
Private Sub cmdClear_Click()
SetParent cboAddr.hwnd, Me.hwnd
Dim i As Integer
For i = 0 To BandCount - 1
RBRemoveBand 0
Next
End Sub
Private Sub cmdCreate_Click()
CreateCoolbar Me.hwnd, ScaleWidth, 5
End Sub
Private Sub cmdDestroy_Click()
DestroyWindow hWndRebar
hWndRebar = 0
End Sub
Private Sub cmdTB_Click()
RBAddBandByhWnd tbr.hwnd, "", BGpic.Picture.Handle
End Sub
Private Sub cmdText_Click()
RBAddBandByhWnd 0, Text1.Text, BGpic.Picture.Handle, True, False
End Sub
Private Sub Form_Load()
Call LoadCommCtls
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If BandCount > 0 Then
cmdClear_Click
End If
If hWndRebar <> 0 Then
cmdDestroy_Click
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
cmdText_Click
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?