| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 851 人关注过本帖
标题:请各位高手看看 我这个图片浏览器怎么终有错啊 本人新手 很难改对啊!!!
只看楼主 加入收藏
zyy394242
Rank: 1
来 自:师古
等 级:新手上路
帖 子:9
专家分:0
注 册:2008-7-11
收藏
 问题点数:0 回复次数:4 
请各位高手看看 我这个图片浏览器怎么终有错啊 本人新手 很难改对啊!!!
各位给个正确的  感激 感激!!!

namespace SeasonImage
{
    public partial class ListBoxSeason : Form
    {
        public ListBoxSeason()
        {
            InitializeComponent();
        }
        enum Season {
        spring,summer,autumn,winter
        }
      private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Season season;
            int index = ListBoxSeason.Selectindex;
            season = (Season)index;
            string filename = @"D:\Image\Season" + season.ToString + ".jpg";
            pictureBoxSeason.Image = Image.Form(filename);

        }
搜索更多相关主题的帖子: 浏览器 
2008-07-14 15:25
釕嶰
Rank: 1
来 自:河南
等 级:新手上路
帖 子:24
专家分:0
注 册:2008-7-11
收藏
得分:0 
我感觉用到了枚举,那你的index初始值应该设为-1
int index=-1;
season = (Season)index;
index = ListBoxSeason.Selectindex;
你再试一下.
2008-07-14 15:49
zyy394242
Rank: 1
来 自:师古
等 级:新手上路
帖 子:9
专家分:0
注 册:2008-7-11
收藏
得分:0 
运行后有以下错误,我不知道怎么改啊!!!
1.已在此范围定义了名为“index”的局部变量。
2.“SeasonImage.ListBoxSeason”并不包含“Selectindex”的定义    
3.运算符“+”无法应用于“string”和“方法组”类型的操作数
4.“System.Drawing.Image”并不包含“Formfile”的定义

稀里糊涂变强了 嘻嘻
2008-07-15 08:34
shmilylee
Rank: 2
来 自:江苏扬州蹩脚小公司
等 级:论坛游民
威 望:2
帖 子:242
专家分:22
注 册:2007-7-6
收藏
得分:0 
Sting index = ListBoxSeason.SelectedItem.ToString();
string filename = @"D:\Image\Season\" + season.index + ".jpg";
2008-07-15 09:14
Apao
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2004-6-9
收藏
得分:0 
看你代码有几个错误哦~
不是少了() 就是拼写错误  Formfile=> FromFile()
2008-07-16 15:56
快速回复:请各位高手看看 我这个图片浏览器怎么终有错啊 本人新手 很难改对啊! ...
数据加载中...
 
   



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

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