zoukankan      html  css  js  c++  java
  • 自定义ComboBox,简简单单实现

            private void Button_Click(object sender, RoutedEventArgs e)
            {
                Popup1.PlacementTarget = TesTextBox;
                Popup1.Placement = PlacementMode.Bottom;
                Popup1.IsOpen = true;
            }
    
            private void TestDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
            {
                TesTextBox.Text = (dataGrid.SelectedItem as DataRowView).Row["c_AirStrategyExpCode"].ToString();
            }
                dataGrid.ItemsSource = ds.Tables[0].DefaultView;
                dataGrid.LoadingRow += DataGridOnLoadingRow;
                    <StackPanel Orientation="Horizontal" Height="40">
                        <TextBlock  Text="ComboBox:" Height="18" Width="70" />
                        <Border Height="22" BorderBrush="DarkGray" BorderThickness="1">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock x:Name="TesTextBox" Height="20" Width="154"/>
                                <Button Height="20" Width="14" Click="Button_Click" Style="{StaticResource FrameBtnStyle4}">
                                    <Popup x:Name="Popup1" Height="300" StaysOpen="False">
                                        <Border BorderBrush="DarkGray"  BorderThickness="1">
                                            <DataGrid x:Name="dataGrid" GridLinesVisibility = "None" CanUserReorderColumns = "false"
                                                      Style="{StaticResource DataGridStyle1}" RowStyle="{StaticResource DataGridRowStyle1}"
                                                      CellStyle="{StaticResource DataGridCellStyle1}" ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle1}"
                                                      IsReadOnly="True" SelectionChanged="TestDataGrid_SelectionChanged"/>
                                        </Border>
                                    </Popup>
                                </Button>
                            </StackPanel>
                        </Border>
                    </StackPanel>
  • 相关阅读:
    ArcGIS学习记录—union、merge及append的区别
    ArcGIS学习记录—属性表的编辑与修改
    ASP.NET应用程序和ASP.NET网站所共有的文件: App_Browsers 等
    C# 文件夹操作
    远程重启服务器
    SQL省市区三级表结构
    c#提出中文首字母
    javascript遍历Json对象个数
    原生javascript添加引用js文件
    简单的div蒙层
  • 原文地址:https://www.cnblogs.com/Events/p/3848072.html
Copyright © 2011-2022 走看看