气球弹出WPF

时间:2012-09-19 16:45:03

标签: c# wpf popup tooltip popup-balloons

我需要显示气球弹出窗口。 WPF中是否有对这种工作的控制? 如下所示:

<BalloonPopup>
   <StackPanel>
      <Button/>
      . . .
   </StackPanel>
</BalloonPopup>

这是可能的结果:

enter image description here

2 个答案:

答案 0 :(得分:1)

您想要tooltip。 wpf.200things上有很好的写作。

来自article。你基本上会像下面那样设置工具提示的样式

<TextBox Text="Now is the winter of our discontent etc"
    Width="100" Margin="10">
    <TextBox.ToolTip>
        <ToolTip DataContext="{Binding Path=PlacementTarget, RelativeSource={x:Static RelativeSource.Self}}">
            <StackPanel>
                <Label FontWeight="Bold" Content="Full Text"/>
                <Label Content="{Binding Text}"/>
                <Label Content="--Gloster, in Richard III (Act I, Scene I)"/>
            </StackPanel>
        </ToolTip>
    </TextBox.ToolTip> </TextBox>

答案 1 :(得分:1)

不知道你是否看到了这个,但在这里你可以找到一些非常好的例子,这对我有同样的帮助。

How to implement Balloon message in a WPF application

相关问题