| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System.ComponentModel;
- namespace qdr.app.tools.qfu.gui.Subforms.Common
- {
- public partial class FileSelectionCtrl : UserControl
- {
- public event EventHandler? SelectedFileChanged;
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
- public string Caption
- {
- get => lblText.Text;
- set => lblText.Text = value;
- }
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
- public string SelectedFile {
- get => tbSelectedPath.Text;
- set => tbSelectedPath.Text = value;
- }
- public FileSelectionCtrl()
- {
- InitializeComponent();
- }
- private void butSelect_Click(object sender, EventArgs e)
- {
- var dlg = new OpenFileDialog
- {
- Title = lblText.Text,
- Filter = "All files (*.*)|*.*",
- Multiselect = false,
- };
- if (dlg.ShowDialog() == DialogResult.OK)
- {
- SelectedFile = dlg.FileName;
- SelectedFileChanged?.Invoke(this, EventArgs.Empty);
- }
- }
- }
- }
|