OpenDialog.cs 928 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace StatsViewer
  12. {
  13. public partial class OpenDialog : Form
  14. {
  15. public OpenDialog()
  16. {
  17. InitializeComponent();
  18. }
  19. /// <summary>
  20. /// Get the user selected filename
  21. /// </summary>
  22. public string FileName
  23. {
  24. get {
  25. return this.name_box_.Text;
  26. }
  27. }
  28. private void button1_Click(object sender, EventArgs e)
  29. {
  30. this.Close();
  31. }
  32. private void OnKeyUp(object sender, KeyEventArgs e)
  33. {
  34. if (e.KeyCode == Keys.Enter)
  35. {
  36. this.Close();
  37. }
  38. }
  39. }
  40. }