C# 如何制作菜单栏 如计算器查看菜单下科学型前的单向选择按钮

如题所述

首先加入 menuStrip 菜单
然后添加两个 MenuItem

然后选中一个item添加资源 image
这个时候你可以在Resources文件夹看到你的资源
我用的是p1.jpg

然后分别在两个item点击事件里面写

private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
toolStripMenuItem2.Image = WindowsFormsApplication1.Properties.Resources.p1;
toolStripMenuItem3.Image = null;
}

private void toolStripMenuItem3_Click(object sender, EventArgs e)
{
toolStripMenuItem3.Image = WindowsFormsApplication1.Properties.Resources.p1;
toolStripMenuItem2.Image = null;
}

就可以做到 显示图标的了追问

Resources文件夹是软件自带的还是后添加的啊,没找到啊

追答

添加资源文件后就有的啊:)
在属性里面不是又个image吗?
点击添加资源
然后就有啦:)

追问

还是不行啊

toolStripMenuItem2.Image = WindowsFormsApplication1.Properties.Resources.2;
toolStripMenuItem3.Image = null;

toolStripMenuItem3.Image = WindowsFormsApplication1.Properties.Resources.2;
toolStripMenuItem2.Image = null;

追答

....用英文名的试试 发的代码都是运行成功了的,不忽悠人的:)

温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-09-10
前面就不说了,221.68.45.123转为八位二进制:11011101.01000100.00101101.01111011
相似回答
大家正在搜