Advertisement
Guest User

Untitled

a guest
May 24th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace C_Sharp_Project {
  12. public partial class Form1 : Form {
  13. public Form1 () {
  14. InitializeComponent ();
  15. }
  16. // Form1 [DESIGN] only had a button in it
  17. private void Button1_Click ( object sender, EventArgs e ) {
  18. OpenFileDialog ofDialog = new OpenFileDialog ();
  19. ofDialog.Title = "Open Image";
  20. ofDialog.Filter = "JPG Image|*.jpg|PNG Image|*.png";
  21. if ( ofDialog.ShowDialog () == System.Windows.Forms.DialogResult.OK ) {
  22. MessageBox.Show ( ofDialog.FileName );
  23. }
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement