I was trying to let a user choose which table to display from my database and I heard the best way of doing so is using the "selectedIndexChanged" event so that when the user clicks on the desired table it immediately displays it. However, for some reason when I click on my comboBox and then events I dont see "selectedIndexChanged" as an option and while writing it manually is says : "The member "SelectedIndexChanged" is not recognized or is not accessible" this is my xaml code :
<Window x:Class="WpfApp1.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:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Canvas Name="mycanvas" Background="LightBlue" Margin="0,0,34.4,-0.2">
<DataGrid Name="g1">
</DataGrid>
<Label Name="l1" Content="" FontWeight="ExtraBold" FontSize="15" Foreground="{x:Null}" Canvas.Left="20"/>
</Canvas>
<Canvas Grid.Column="1">
<Label Name="Instruction" Content="Choose a table" FontWeight="ExtraBold" FontSize="15" Canvas.Left="-23" Canvas.Top="62"/>
<ComboBox SelectedIndexChanged="b1" Name="ComboBox1" FontWeight="Bold" FontSize="15" Canvas.Top="98" Width="135" Height="24" Canvas.Left="-31">
<ComboBoxItem Foreground="#FF3FA4C5" Name="classesTbl">classesTbl</ComboBoxItem>
<ComboBoxItem Foreground="#FF3FA4C5" Name="gradesTbl">gradesTbl</ComboBoxItem>
<ComboBoxItem Foreground="#FF3FA4C5" Name="studentsTbl">studentsTbl</ComboBoxItem>
<ComboBoxItem Foreground="#FF3FA4C5" Name="subjectsTbl">subjectsTbl</ComboBoxItem>
<ComboBoxItem Foreground="#FF3FA4C5" Name="subjectsTeachers">subjectsTeachers</ComboBoxItem>
<ComboBoxItem Foreground="#FF3FA4C5" Name="TeachersTbl">TeachersTbl</ComboBoxItem>
</ComboBox>
</Canvas>
</Grid>
Does anyone know how to solve it or what I did wrong?