我试图让用户从我的数据库中选择要显示的表,我听说这样做的最佳方法是使用“selectedIndexChanged”事件,这样当用户单击所需的表时,它会立即显示它。但是,出于某种原因,当我单击我的组合框然后单击事件时,我没有看到“selectedIndexChanged”作为一个选项,并且在手动编写时显示:“无法识别成员“SelectedIndexChanged”或无法访问“这是我的 xaml 代码:
<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"/>
有谁知道如何解决它或我做错了什么?在下面的代码片段中,我要求用户输入他们的目录路径以定位他们要转换的 .pdf 文件。但是,我希望能够一次转换一批 .pdf 文件。我怎么能去做这件事?假设用户在目录路径中有 100 个 .pdf 文件,每个文件都有不同的文件名。更改我的代码以便能够一次批量转换所有 .pdf 文件的最佳方法是什么?
相关分类