一道VB的编程题 创建一个应用程序 15
创建应用程序,为文本框设计图中的快捷菜单改变粗体和下划线效果。命令加复选标记表示应用相应的效果,否则不应用效果。(图在:http://hi.baidu.com/crazy...
创建应用程序,为文本框设计图中的快捷菜单改变粗体和下划线效果。命令加复选标记表示应用相应的效果,否则不应用效果。
(图在:http://hi.baidu.com/crazyna123/album/item/f381a22dd1591529359bf70d.html#IMG=e153c010c266f5e1c2ce790e)
我还有另外一道题 也请大家帮帮忙啦
http://zhidao.baidu.com/question/78226527.html 展开
(图在:http://hi.baidu.com/crazyna123/album/item/f381a22dd1591529359bf70d.html#IMG=e153c010c266f5e1c2ce790e)
我还有另外一道题 也请大家帮帮忙啦
http://zhidao.baidu.com/question/78226527.html 展开
展开全部
因为设计菜单问题,不好直接描述,所以给你Frm文件的内容。把下面的代码用记事本保存为后缀名为.frm的文件中,再用VB打开。
============================
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 975
Left = 600
TabIndex = 0
Text = "Text1"
Top = 1080
Width = 3255
End
Begin VB.Menu mnu
Caption = "mnu"
Visible = 0 'False
Begin VB.Menu mnu1
Caption = "粗体"
End
Begin VB.Menu mnu2
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 mnu1_Click()
mnu1.Checked = Not mnu1.Checked
Text1.FontBold = mnu1.Checked
End Sub
Private Sub mnu2_Click()
mnu2.Checked = Not mnu2.Checked
Text1.FontUnderline = mnu2.Checked
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then PopupMenu mnu
End Sub
============================
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 975
Left = 600
TabIndex = 0
Text = "Text1"
Top = 1080
Width = 3255
End
Begin VB.Menu mnu
Caption = "mnu"
Visible = 0 'False
Begin VB.Menu mnu1
Caption = "粗体"
End
Begin VB.Menu mnu2
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 mnu1_Click()
mnu1.Checked = Not mnu1.Checked
Text1.FontBold = mnu1.Checked
End Sub
Private Sub mnu2_Click()
mnu2.Checked = Not mnu2.Checked
Text1.FontUnderline = mnu2.Checked
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then PopupMenu mnu
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 975
Left = 600
TabIndex = 0
Text = "Text1"
Top = 1080
Width = 3255
End
Begin VB.Menu mnu
Caption = "mnu"
Visible = 0 'False
Begin VB.Menu mnu1
Caption = "粗体"
End
Begin VB.Menu mnu2
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 mnu1_Click()
mnu1.Checked = Not mnu1.Checked
Text1.FontBold = mnu1.Checked
End Sub
Private Sub mnu2_Click()
mnu2.Checked = Not mnu2.Checked
Text1.FontUnderline = mnu2.Checked
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then PopupMenu mnu
End Sub
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 975
Left = 600
TabIndex = 0
Text = "Text1"
Top = 1080
Width = 3255
End
Begin VB.Menu mnu
Caption = "mnu"
Visible = 0 'False
Begin VB.Menu mnu1
Caption = "粗体"
End
Begin VB.Menu mnu2
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 mnu1_Click()
mnu1.Checked = Not mnu1.Checked
Text1.FontBold = mnu1.Checked
End Sub
Private Sub mnu2_Click()
mnu2.Checked = Not mnu2.Checked
Text1.FontUnderline = mnu2.Checked
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then PopupMenu mnu
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询