| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2819 人关注过本帖
标题:3个radioButton如何使用的问题
取消只看楼主 加入收藏
freshman
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-10-29
收藏
 问题点数:0 回复次数:2 
3个radioButton如何使用的问题

我做了个软件,其中有一项要设置参数,0为钢琴radioButton1,6为古钢琴radioButton2,20为风琴radioButton3,
我做了个类比如
public int ints()
{
int i;
if(radioButton1.checked)
i=0;
else if(radioButton2.checked)
i=6;
else if(radioButton3.checked)
i=20;
}
然后调用这个方法 int intsa=ints();
但调式时出现:并非所有的代码路径都返回值

搜索更多相关主题的帖子: radioButton 风琴 钢琴 int else 
2007-04-25 22:50
freshman
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-10-29
收藏
得分:0 

加在最后了,但调式时出:使用了未赋值的局部变量“i”

2007-04-26 09:19
freshman
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2005-10-29
收藏
得分:0 

public int ints()
{
int i;
if(this.radioButton1.Checked)
i=0;
else if(this.radioButton2.Checked)
i=6;
else if(this.radioButton3.Checked)
i=20;

return i;
}


改哪里 ?

[此贴子已经被作者于2007-4-26 10:43:35编辑过]

2007-04-26 10:42
快速回复:3个radioButton如何使用的问题
数据加载中...
 
   



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

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