BC220405797 CS411-Visual Programming Assignment No.2 Fall 24 Output Screenshot
BC220405797 CS411-Visual Programming Assignment No.2 Fall 24 Output Screenshot
CS411-Visual Programming
Output Screenshot:
XAML Code:
<Window x:Class="CS411_2_FALL24.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CS411_2_FALL24"
mc:Ignorable="d"
<Grid Margin="0,0,0,-10">
HorizontalAlignment="Center" VerticalContentAlignment="Center"
FontWeight="Bold" FontSize="16"/>
</Border>
</Grid>
</Window>
C# Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 CS411_2_FALL24
/// <summary>
/// </summary>
public MainWindow()
InitializeComponent();
try
{
return;
txtBMI.Text = bmi.ToString("F2");
catch (FormatException)
MessageBox.Show("Please enter valid numeric values for Weight and Height.", "Input
Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
catch (Exception ex)