| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 476 人关注过本帖
标题:有问题一定帮忙
只看楼主 加入收藏
songyan008
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-3-17
收藏
 问题点数:0 回复次数:6 
有问题一定帮忙

创建一应用程序,当单击左边的按钮时,左边按钮显示为"显示",右边按钮显示为"单击我",文档框中显示"你单击的是左边的按钮",文本框的背景颜色变为橙色。当单击右边的按钮时,右边按钮显示为" 单击我",左边按
钮显示为"显示",文本框中显示"你单击的是右边的按钮",文本框的背景颜色变为黄色。

这是我自己编写的程序,但是由于我是新手所以我在 当单击左边的按钮时,左边按钮显示为"显示"和当单击右边的按钮时,右边按钮显示为" 单击我",左边按钮显示为"显示"这两种按钮相互转换时不知道如何下手了.请个位高手指点指点,我在这里先表示感谢.
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnshow.Click
TextB.Text = "你单击的是左边的按钮"
TextB.BackColor = Color.Orange
End Sub


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnshow1.Click
TextB.Text = "你单击的是右边的按钮"
TextB.BackColor = Color.Red
End Sub
End Class

2007-03-18 19:29
liuminghui
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:2882
专家分:0
注 册:2007-1-26
收藏
得分:0 
我来帮你看看吧

海鸽 is My Lover!!
2007-03-20 11:04
liuminghui
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:2882
专家分:0
注 册:2007-1-26
收藏
得分:0 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

TextB.Text = "你单击的是左边的按钮"
TextB.BackColor = Color.Orange

Button2.Text = "显示"
Button1.Text = "单击我"

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextB.Text = "你单击的是右边的按钮"
TextB.BackColor = Color.Red

Button1.Text = "显示"
Button2.Text = "单击我"
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Text = "显示"
Button2.Text = "单击我"

End Sub


海鸽 is My Lover!!
2007-03-20 11:14
liuminghui
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:2882
专家分:0
注 册:2007-1-26
收藏
得分:0 
说明:
首先,设置窗体刚刚显示时按钮的名称,然后每次点击都改变一下

海鸽 is My Lover!!
2007-03-20 11:16
songyan008
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-3-17
收藏
得分:0 
回复:(liuminghui)Private Sub Button1_Click(ByVa...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Text = "显示"
Button2.Text = "单击我"
这段程序是什么意思啊
2007-03-22 18:39
songyan008
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-3-17
收藏
得分:0 
回复:(liuminghui)Private Sub Button1_Click(ByVa...

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
button1.Text = "显示"
TextB.Text = "你点击的是左边的按钮"
TextB.BackColor = Color.Orange
button2.Text = "点击我"
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
button1.Text = "点击我"
TextB.Text = "你点击的是右边的按钮"
TextB.BackColor = Color.Yellow
button2.Text = "显示"
End Sub

End Class
这是我经过你们的指点做出来的 结果是正确的 谢谢你们啊

2007-03-22 18:50
liuminghui
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:2882
专家分:0
注 册:2007-1-26
收藏
得分:0 
不好意思啊,没有看到你发的贴,刚刚看到

恭喜问题已经解决

海鸽 is My Lover!!
2007-03-23 09:02
快速回复:有问题一定帮忙
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022662 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved