gpt4 book ai didi

c# - DevExpress Windows 窗体的文件上传控件

转载 作者:太空宇宙 更新时间:2023-11-03 13:41:24 25 4
gpt4 key购买 nike

我是 DevExpress WinForms 的新手,谁能告诉我使用 FileUploader 控件的简单方法是什么。 我想从文件对话框中选择图像并将其添加到 PictureEdit。

请帮忙!!提前致谢。

最佳答案

不幸的是,Devexpress 不提供文件上传控制( See This),因此您只能在代码中使用 native 文件 uploader 。

一个简单的代码是

    // Create OpenFileDialog
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
dlg.Filter = "image Files|*.jpg";

Nullable<bool> result = dlg.ShowDialog();
if (result == true)
{
this.pictureEdit1.Image = Image.FromFile(dlg.FileName) // Not tested this one
}

希望对你有帮助

关于c# - DevExpress Windows 窗体的文件上传控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16850996/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com