C#在面板背景图像上显示ico图标... [英] C# Show ico icon on panel background image ...
本文介绍了C#在面板背景图像上显示ico图标...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
windows 2000-窗口7,我将如何使用openfilwdilog1搜索快捷方式并获取该快捷方式的图像以显示在panel1背景图像上?有人可以帮忙吗?我在interwebs上的任何地方都找不到它.
windows 2000 - window 7, how would i use a openfilwdilog1, to search for a shortcut and get the image of the shortcut to appear on the panel1 background image? can anyone help? I can''t find it any where on the interwebs
推荐答案
尝试一下:
Try this :
string path = String.Empty;
OpenFileDialog openfilwdilog1= new OpenFileDialog();
if (openfilwdilog1.ShowDialog() == DialogResult.OK)
{
path = openfilwdilog1.FileName;
}
// Image img = new Bitmap(path);
panel1.BackgroundImage = Image.FromFile(path);
我认为这会有所帮助:
获取C#中已注册的文件类型及其关联的图标 [
I think this will help:
Get Registered File Types and Their Associated Icons in C#[^]
这篇关于C#在面板背景图像上显示ico图标...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文