4个回答
展开全部
Frame的作用主要有两个:
1,美观。把一些同类的控件用一个“框”框起来,给人的感觉是别叫干净利落,整洁大方
2,使单选按钮每次只能选中一个,如果没有把单选按钮放在Frame中,单选按钮也就失去了意义。也就是说,frame使好几个单选按钮成为“一组”
1,美观。把一些同类的控件用一个“框”框起来,给人的感觉是别叫干净利落,整洁大方
2,使单选按钮每次只能选中一个,如果没有把单选按钮放在Frame中,单选按钮也就失去了意义。也就是说,frame使好几个单选按钮成为“一组”
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
一些作用像一楼和二楼两位说的,我就不再重复说了。另外,如果能善于利用它的Visibe属性,还可以作出意想不到的效果。
下面是我给你作的示例代码,你把这些代码复制到记事本中,并保存为Form1.frm,然后运行看看。
VERSION 5.00
Begin VB.Form Form1
Caption = "Frame示例"
ClientHeight = 6315
ClientLeft = 165
ClientTop = 855
ClientWidth = 8985
LinkTopic = "Form1"
ScaleHeight = 6315
ScaleWidth = 8985
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame3
Caption = "第三面"
Height = 6255
Left = 0
TabIndex = 5
Top = 0
Visible = 0 'False
Width = 8895
Begin VB.Label Label4
Caption = "这里是软件的第三面"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1695
Left = 840
TabIndex = 6
Top = 2400
Width = 5535
End
End
Begin VB.Frame Frame2
Caption = "第二面"
Height = 6255
Left = 0
TabIndex = 3
Top = 0
Visible = 0 'False
Width = 8895
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 1575
Index = 3
Left = 2520
Style = 1 'Graphical
TabIndex = 13
Top = 360
Width = 615
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 1575
Index = 2
Left = 1920
Style = 1 'Graphical
TabIndex = 12
Top = 360
Width = 615
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 1575
Index = 1
Left = 1320
Style = 1 'Graphical
TabIndex = 11
Top = 360
Width = 615
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 1575
Index = 0
Left = 720
Style = 1 'Graphical
TabIndex = 10
Top = 360
Width = 615
End
Begin VB.Label Label3
Caption = "这里是软件的第二面"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1695
Left = 1200
TabIndex = 4
Top = 3480
Width = 5535
End
End
Begin VB.Frame Frame1
Caption = "第一面"
Height = 6255
Left = 0
TabIndex = 1
Top = 0
Visible = 0 'False
Width = 8895
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 495
Index = 2
Left = 3480
TabIndex = 9
Top = 360
Width = 1935
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 495
Index = 1
Left = 2040
TabIndex = 8
Top = 360
Value = -1 'True
Width = 1935
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 495
Index = 0
Left = 720
TabIndex = 7
Top = 360
Width = 1935
End
Begin VB.Label Label2
Caption = "这里是软件的第一面"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1695
Left = 2040
TabIndex = 2
Top = 2520
Width = 5535
End
End
Begin VB.Label Label1
Caption = "这里是软件封面"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1695
Left = 1920
TabIndex = 0
Top = 2040
Width = 5535
End
Begin VB.Menu sys
Caption = "系统"
Begin VB.Menu NO1
Caption = "第一面"
End
Begin VB.Menu NO2
Caption = "第二面"
End
Begin VB.Menu NO3
Caption = "第三面"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub NO1_Click()
Frame1.Visible = True
Frame2.Visible = False
Frame3.Visible = False
End Sub
Private Sub NO2_Click()
Frame1.Visible = False
Frame2.Visible = True
Frame3.Visible = False
End Sub
Private Sub NO3_Click()
Frame1.Visible = False
Frame2.Visible = False
Frame3.Visible = True
End Sub
下面是我给你作的示例代码,你把这些代码复制到记事本中,并保存为Form1.frm,然后运行看看。
VERSION 5.00
Begin VB.Form Form1
Caption = "Frame示例"
ClientHeight = 6315
ClientLeft = 165
ClientTop = 855
ClientWidth = 8985
LinkTopic = "Form1"
ScaleHeight = 6315
ScaleWidth = 8985
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame3
Caption = "第三面"
Height = 6255
Left = 0
TabIndex = 5
Top = 0
Visible = 0 'False
Width = 8895
Begin VB.Label Label4
Caption = "这里是软件的第三面"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1695
Left = 840
TabIndex = 6
Top = 2400
Width = 5535
End
End
Begin VB.Frame Frame2
Caption = "第二面"
Height = 6255
Left = 0
TabIndex = 3
Top = 0
Visible = 0 'False
Width = 8895
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 1575
Index = 3
Left = 2520
Style = 1 'Graphical
TabIndex = 13
Top = 360
Width = 615
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 1575
Index = 2
Left = 1920
Style = 1 'Graphical
TabIndex = 12
Top = 360
Width = 615
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 1575
Index = 1
Left = 1320
Style = 1 'Graphical
TabIndex = 11
Top = 360
Width = 615
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 1575
Index = 0
Left = 720
Style = 1 'Graphical
TabIndex = 10
Top = 360
Width = 615
End
Begin VB.Label Label3
Caption = "这里是软件的第二面"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1695
Left = 1200
TabIndex = 4
Top = 3480
Width = 5535
End
End
Begin VB.Frame Frame1
Caption = "第一面"
Height = 6255
Left = 0
TabIndex = 1
Top = 0
Visible = 0 'False
Width = 8895
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 495
Index = 2
Left = 3480
TabIndex = 9
Top = 360
Width = 1935
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 495
Index = 1
Left = 2040
TabIndex = 8
Top = 360
Value = -1 'True
Width = 1935
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 495
Index = 0
Left = 720
TabIndex = 7
Top = 360
Width = 1935
End
Begin VB.Label Label2
Caption = "这里是软件的第一面"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1695
Left = 2040
TabIndex = 2
Top = 2520
Width = 5535
End
End
Begin VB.Label Label1
Caption = "这里是软件封面"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1695
Left = 1920
TabIndex = 0
Top = 2040
Width = 5535
End
Begin VB.Menu sys
Caption = "系统"
Begin VB.Menu NO1
Caption = "第一面"
End
Begin VB.Menu NO2
Caption = "第二面"
End
Begin VB.Menu NO3
Caption = "第三面"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub NO1_Click()
Frame1.Visible = True
Frame2.Visible = False
Frame3.Visible = False
End Sub
Private Sub NO2_Click()
Frame1.Visible = False
Frame2.Visible = True
Frame3.Visible = False
End Sub
Private Sub NO3_Click()
Frame1.Visible = False
Frame2.Visible = False
Frame3.Visible = True
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Frame 控件为控件提供可标识的分组。Frame 可以在功能上进一步分割一个窗体-例如,把 OptionButton 控件分成几组。
语法
Frame
说明
为了将控件分组,首先需要绘制 Frame 控件,然后绘制 Frame 里面的控件。这样就可以把框架和里面的控件同时移动。如果在 Frame 外部绘制了一个控件并试图把它移到框架内部,那么控件将在 Frame 的上部,这时需分别移动 Frame 和控件。
为了在 Frame 中选择多个控件,在使用鼠标在控件周围绘制框时,按住 CTRL 键
语法
Frame
说明
为了将控件分组,首先需要绘制 Frame 控件,然后绘制 Frame 里面的控件。这样就可以把框架和里面的控件同时移动。如果在 Frame 外部绘制了一个控件并试图把它移到框架内部,那么控件将在 Frame 的上部,这时需分别移动 Frame 和控件。
为了在 Frame 中选择多个控件,在使用鼠标在控件周围绘制框时,按住 CTRL 键
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询