c# wpf怎么在图片上加个label

c# wpf怎么在图片上加个label,第1张

添加一个Gird

Gird中添加一个label,位置你自己设;

Grid的Background设为该图片,ImageBrush,你自己查查吧;

至于margin随时变化,怎么个变法,你没说清,必要时可以后台代码 *** 作。

使用TabControl就可以了,示例如下:

<Window x:Class="WpfApplication2.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        title="MainWindow">

    <TabControl>

        <TabItem Header="选择初始条件">

            <Grid Width="480" Height="320">

               

            </Grid>

        </TabItem>

        <TabItem Header="选择焊接方法和材料">

           

        </TabItem>

<!--添加其余的TabItem-->

    </TabControl>

</Window>

效果如图:

希望对你有帮助,还有疑问请追问或是Hi

1.使用绝对坐标

<Canvas>

    <Label Content="..." Width="60" Height="25" Canvas.Left="50" Canvas.Top="50" />

</Canvas>

2.使用 Grid

<Grid>

    <Grid.ColumnDefinitions>

        <ColumnDefinition Width="50" />

        <ColumnDefinition />

    </Grid.ColumnDefinitions>

    <Grid.RowDefinitions>

        <RowDefinition Height="50" />

        <RowDefinition />

    </Grid.RowDefinitions>

    <Label Content="..." Width="60" Height="25" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" />

</Grid>

方法多多


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/bake/11577197.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-17
下一篇 2023-05-17

发表评论

登录后才能评论

评论列表(0条)

保存