为按钮添加注释

时间:2012-05-16 08:21:27

标签: c# wpf button tags

我需要使用c#语言在asp.net中为按钮添加标签。每当鼠标按下按钮时,我都需要可以查看标签。我正在设计一个wpf应用程序。任何帮助表示赞赏。

2 个答案:

答案 0 :(得分:2)

如果这是WPF,我认为您不需要标签,因为在指向控件时标签不可见,但工具提示是。

<Button Content="Submit" Tooltip="Click this to submit" 
    Command="{Binding SubmitCommand}"/>

答案 1 :(得分:1)

我认为你在谈论工具提示:

<Button Content="Submit">
<Button.ToolTip>
    <ToolTip>
        <StackPanel>
            <TextBlock FontWeight="Bold">Submit Request</TextBlock>
            <TextBlock>Submits the request to the server.</TextBlock>
        </StackPanel>
    </ToolTip>
</Button.ToolTip>

相关问题