• WPF —— TextBlock、LineBreak RadioButton控件详解


    一:TextBlock

    1:TextBlock 简介

    换行

    显示文本 标签内容和content属性共存

    2、TextBlock 常用的属性

        Foreground:TextBlock的文本内容的颜色。

        Background:背景,获取或设置要用于填充内容区域背景的 Brush。

        FontFamily:获取或设置 TextBlock 的首选最常用字体系列。

        FontSize:TextBlock的字体大小

        FontStretch:获取或设置 TextBlock 的常用字体拉伸特征。

        FontStyle:获取或设置 TextBlock 的顶级字体样式。

    3 关于 TextBlock、LineBreak的实例

    1. "青海洪水" FontSize="40" FontWeight="Bold" Foreground="Red">
    2. 你好
    3. 娃哈哈领导人去世了
    4. 比亚迪秦15万左右,新款和比亚迪秦一样,
    5. 但是价格七八万

    二 :RadioButton单选框

    实现分组的单选框,可以通过一下几种方式进行分组

    1 通过groupName设置相同值进行分组
    2 通过把单选框添加一个相同父标签

    关于RadioButton的实例

    1. "sex" Content="男" FontSize="20" Foreground="blue"
    2. VerticalContentAlignment="Center" Width="100" Height="40"
    3. HorizontalAlignment="Left" VerticalAlignment="top"
    4. >
    5. "sex" Content="女" FontSize="20" Foreground="blue"
    6. VerticalContentAlignment="Center" Width="100" Height="40"
    7. HorizontalAlignment="Left" VerticalAlignment="top" Margin="110,0"
    8. >
    9. "sex" Content="中" FontSize="20" Foreground="blue"
    10. VerticalContentAlignment="Center" Width="100" Height="40"
    11. HorizontalAlignment="Left" VerticalAlignment="top" Margin="220,0"
    12. IsChecked="True"
    13. >
    14. "g2">
    15. "苹果" FontSize="20" Foreground="blue"
    16. VerticalContentAlignment="Center" Width="261" Height="40"
    17. HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,50,0,0"
    18. >
    19. "香蕉" FontSize="20" Foreground="blue"
    20. VerticalContentAlignment="Center" Width="472" Height="40"
    21. HorizontalAlignment="Left" VerticalAlignment="Top" Margin="318,50,0,0"
    22. IsChecked="True"
    23. >

    效果图如下

  • 相关阅读:
    pgpool-II 4.3 中文手册-前言
    「Whale Cast」功能更新,让全网看到您的直播高光时刻
    【Java快速复习】一.数据类型与结构设计
    Typora收费?搭建VS Code MarkDown写作环境
    RGB转频域分析
    国内DNS首选
    2022 Nomachine 最简安装与使用指南
    k8s 裸金属集群部署metalLB软负载均衡 —— 筑梦之路
    JSP中的cookie对象和Date时间类
    人工智能学习03——mnist手写数字实战
  • 原文地址:https://blog.csdn.net/lu2023_8_6/article/details/136632410