added some practice examples

This commit is contained in:
Digi
2024-11-07 07:00:00 +01:00
parent 5452d2423b
commit 9d05ca3229
244 changed files with 3748 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
using Microsoft.Win32;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace filedialog
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void btnFire_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Image files |*.bmp;*.jpg;*.png";
ofd.FilterIndex = 1;
bool?success = ofd.ShowDialog();
if (success == true)
{
string path = ofd.FileName;
tbInfo.Text = path;
imageholder.Source = new BitmapImage(new Uri(path));
}
else
{
//no
}
}
}
}