小编Tom*_*Tom的帖子

WPF:标签不会显示在代码后面

好的,所以我一直在寻找一个anwser,但我开始怀疑,如果我看到它,我是否会知道它.我是WPF的新手,但几年来一直在C#中使用Windows Forms.

我的问题是:为什么我不能从我"拖放"到网格后面的代码中访问标签并重命名?

XML代码:

<Window x:Class="IMCommand.NewProblemWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="New Problem" Height="800" Width="800" Loaded="Window_Loaded">
    <Grid>
        <GroupBox Header="Initial Detection and Recording" Height="168" HorizontalAlignment="Left" Margin="12,45,0,0" Name="groupBox1" VerticalAlignment="Top" Width="754" FontSize="15">
            <Grid>
                <Label Content="Application/Server" Height="28" HorizontalAlignment="Left" Margin="6,6,0,0" Name="label1" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="144,11,0,0" Name="textBox1" VerticalAlignment="Top" Width="324" Background="#FFCBCBCB"></TextBox>

                <Label Content="AE Problem Ticket #" Height="28" HorizontalAlignment="Left" Margin="6,52,0,0" Name="label2" VerticalAlignment="Top" />
                <TextBox Background="#FFCBCBCB" Height="23" HorizontalAlignment="Left" Margin="155,54,0,0" Name="BOX_AEProblem" VerticalAlignment="Top" Width="175" />

                <Label Content="Start Time" Height="28" HorizontalAlignment="Left" Margin="6,86,0,0" Name="label4" VerticalAlignment="Top" Width="85" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="97,91,0,0" Name="BOX_StartTime" VerticalAlignment="Top" …
Run Code Online (Sandbox Code Playgroud)

wpf code-behind wpf-controls

4
推荐指数
2
解决办法
8373
查看次数

标签 统计

code-behind ×1

wpf ×1

wpf-controls ×1