ขนาดวิดีโอ: 1280 X 720853 X 480640 X 360
แสดงแผงควบคุมโปรแกรมเล่น
เล่นอัตโนมัติ
เล่นใหม่
MAM CODE DY DAIN...
//Put your XAML code (code of the MainWindow.xaml file) here //Put your C# code (code of the MainWindow.xaml.cs file) hereusing System;using System.Windows;namespace CS411_2_Fall2024{ public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void btnCalculate_Click(object sender, RoutedEventArgs e) { try { // Validate input if (string.IsNullOrWhiteSpace(txtHeight.Text) || string.IsNullOrWhiteSpace(txtWeight.Text)) { MessageBox.Show("Please enter both height and weight.", "Input Error", MessageBoxButton.OK, MessageBoxImage.Warning); return; } // Parse height and weight double height = double.Parse(txtHeight.Text); double weight = double.Parse(txtWeight.Text); // Height conversion and BMI calculation height = height / 100; // Convert to meters double bmi = weight / (height * height); // Display rounded BMI txtBMI.Text = Math.Round(bmi, 2).ToString(); } catch (FormatException) { MessageBox.Show("Please enter valid numeric values for height and weight.", "Format Error", MessageBoxButton.OK, MessageBoxImage.Error); } catch (Exception ex) { MessageBox.Show($"An unexpected error occurred: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } }}
thanks dear your the best
thanks for motivation 🙂
great effort
thanks
@@learningwithmisskhattak mam code plz
mam video bohat achi hai but plz music na lgaya kryn is tarah achy sy awaaz ka pta nai chlta
ok insha ALLAH..
mam Mara yh wpf mara ni show ho rha
MAM CODE DY DAIN...
//Put your XAML code (code of the MainWindow.xaml file) here
//Put your C# code (code of the MainWindow.xaml.cs file) here
using System;
using System.Windows;
namespace CS411_2_Fall2024
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void btnCalculate_Click(object sender, RoutedEventArgs e)
{
try
{
// Validate input
if (string.IsNullOrWhiteSpace(txtHeight.Text) || string.IsNullOrWhiteSpace(txtWeight.Text))
{
MessageBox.Show("Please enter both height and weight.", "Input Error",
MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
// Parse height and weight
double height = double.Parse(txtHeight.Text);
double weight = double.Parse(txtWeight.Text);
// Height conversion and BMI calculation
height = height / 100; // Convert to meters
double bmi = weight / (height * height);
// Display rounded BMI
txtBMI.Text = Math.Round(bmi, 2).ToString();
}
catch (FormatException)
{
MessageBox.Show("Please enter valid numeric values for height and weight.", "Format Error",
MessageBoxButton.OK, MessageBoxImage.Error);
}
catch (Exception ex)
{
MessageBox.Show($"An unexpected error occurred: {ex.Message}", "Error",
MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}
}
thanks dear your the best
thanks for motivation 🙂
great effort
thanks
@@learningwithmisskhattak mam code plz
//Put your XAML code (code of the MainWindow.xaml file) here
//Put your C# code (code of the MainWindow.xaml.cs file) here
using System;
using System.Windows;
namespace CS411_2_Fall2024
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void btnCalculate_Click(object sender, RoutedEventArgs e)
{
try
{
// Validate input
if (string.IsNullOrWhiteSpace(txtHeight.Text) || string.IsNullOrWhiteSpace(txtWeight.Text))
{
MessageBox.Show("Please enter both height and weight.", "Input Error",
MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
// Parse height and weight
double height = double.Parse(txtHeight.Text);
double weight = double.Parse(txtWeight.Text);
// Height conversion and BMI calculation
height = height / 100; // Convert to meters
double bmi = weight / (height * height);
// Display rounded BMI
txtBMI.Text = Math.Round(bmi, 2).ToString();
}
catch (FormatException)
{
MessageBox.Show("Please enter valid numeric values for height and weight.", "Format Error",
MessageBoxButton.OK, MessageBoxImage.Error);
}
catch (Exception ex)
{
MessageBox.Show($"An unexpected error occurred: {ex.Message}", "Error",
MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}
}
mam video bohat achi hai but plz music na lgaya kryn is tarah achy sy awaaz ka pta nai chlta
ok insha ALLAH..
mam Mara yh wpf mara ni show ho rha