简体   繁体   English

DevExpress Windows窗体的FileUpload控件

[英]FileUpload Control For DevExpress Windows Form

I am new to DevExpress WinForms , Can any one tell what is simple way to use FileUploader control . 我是DevExpress WinForms的新手,任何人都可以告诉您使用FileUploader控件的简单方法是什么。 I want to select image from File Dialog box and add it to PictureEdit. 我想从“文件”对话框中选择图像并将其添加到PictureEdit。

Please Help!! 请帮忙!! Thanks In Advance. 提前致谢。

Unfortunately Devexpress does not provide file upload control ( See This ),so that leaves you using native file uploader in your code. 不幸的是,Devexpress不提供文件上传控制( 请参阅参考资料 ),因此您可以在代码中使用本机文件上传器。

A simple code would be 一个简单的代码是

    // 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
     }

Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM