• WPF 控件


    ****ScrollViewer****

    前台:

    <ScrollViewer  HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Left" Margin="96,66,0,0" Name="scrollViewer1" VerticalAlignment="Top" Width="218"  Height="115">
                <TextBlock  HorizontalAlignment="Left" Margin="96,2,0,0" Name="textBlock1" VerticalAlignment="Top" />
            </ScrollViewer>

    后台:

     textBlock1.Text = "dfsdfsdfsdfsdfsdfsdfsdfdfsdfsdf" "sdf“

    ****ListView****

    前台:

    <ListView Height="100" HorizontalAlignment="Left" Margin="12,12,0,0" Name="listView1" VerticalAlignment="Top" Width="300" >
                <ListView.View>
                    <GridView x:Name="gridView1">
                        <GridViewColumn Header="商品名称" DisplayMemberBinding="{Binding Path=GoodsName}"></GridViewColumn>
                        <GridViewColumn Header="内容" DisplayMemberBinding="{Binding Path=GoodsIntroduce}"></GridViewColumn>
                    </GridView>
                </ListView.View>
            </ListView>

    后台:

     public MainWindow()
            {
                InitializeComponent();
                string sql = "server=.;database=db_Tome1;uid=sa;pwd=123456";//连接字符串
                SqlConnection sqlcon = new SqlConnection(sql);//
                string sqlstr = "select GoodsName,GoodsIntroduce from tb_GoodsInfo";
                SqlDataAdapter da = new SqlDataAdapter(sqlstr, sqlcon);
                DataSet ds = new DataSet();
                ds.Clear();
                DataTable table1 = new DataTable();
                sqlcon.Open();
                da.Fill(ds, "table1");
                listView1.ItemsSource = ds.Tables[0].DefaultView;
                sqlcon.Dispose();
                sqlcon.Close();
               
            }

    ****Expander****

    <StackPanel Margin="20,20" Width="100" Height="460" HorizontalAlignment="Left"  
                    VerticalAlignment="Top">
                <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
                    <Expander.Header>
                        <TextBlock Text="用户管理" FontSize="14" FontWeight="Bold" />
                    </Expander.Header>
                    <Expander.Content>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                            </Grid.RowDefinitions>
                            <RadioButton Grid.Row="0">会员管理</RadioButton>
                            <RadioButton Grid.Row="1">角色管理</RadioButton>
                        </Grid>
                    </Expander.Content>
                </Expander>
                <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
                    <Expander.Header>
                        <TextBlock Text="文档管理" FontSize="14" FontWeight="Bold" />
                    </Expander.Header>
                    <Expander.Content>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                            </Grid.RowDefinitions>
                            <RadioButton Grid.Row="0">部门资料</RadioButton>
                            <RadioButton Grid.Row="1">员工资料</RadioButton>
                            <RadioButton Grid.Row="2">职位资料</RadioButton>
                        </Grid>
                    </Expander.Content>
                </Expander>
                <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
                    <Expander.Header>
                        <TextBlock Text="采购管理" FontSize="14" FontWeight="Bold" />
                    </Expander.Header>
                    <Expander.Content>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                            </Grid.RowDefinitions>
                            <RadioButton Grid.Row="0">采购计划</RadioButton>
                            <RadioButton Grid.Row="1">需求分析</RadioButton>
                            <RadioButton Grid.Row="2">采购单</RadioButton>
                            <RadioButton Grid.Row="3">入库验收</RadioButton>
                            <RadioButton Grid.Row="4">入库退回</RadioButton>
                        </Grid>
                    </Expander.Content>
                </Expander>
                <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
                    <Expander.Header>
                        <TextBlock Text="供应商" FontSize="14" FontWeight="Bold" />
                    </Expander.Header>
                    <Expander.Content>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                            </Grid.RowDefinitions>
                            <RadioButton Grid.Row="0">基本资料</RadioButton>
                            <RadioButton Grid.Row="1">往来单位</RadioButton>
                            <RadioButton Grid.Row="2">上游供应商</RadioButton>
                        </Grid>
                    </Expander.Content>
                </Expander>
            </StackPanel>

  • 相关阅读:
    pythonsys.exit()
    Python字符串格式化
    Json概述以及python对json的相关操作
    python学习笔记——异常
    Python:sys.argv[]用法
    python学习笔记——字符串,列表,字典,集合,数值,sorted
    python class 的属性
    Python模块——unittest 单元测试
    从sql2000 复制数据到sql2005
    abstract、virtual及override
  • 原文地址:https://www.cnblogs.com/zhaoliang831214/p/3547722.html
Copyright © 2020-2023  润新知