Balloon Popup WPF

梦想与她 提交于 2019-12-10 16:27:35

问题


I need to display a baloon popup. Is there a control in WPF for this kind of work? Something like the following:

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

This is the possible result:


回答1:


You want to do a tooltip. wpf.200things has a great write on on it.

From this article. You are basically going to style the tooltip like below

<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>



回答2:


Dont know if you saw this but here you can find some pretty nice examples, that helped me in the same situation.

How to implement Balloon message in a WPF application



来源:https://stackoverflow.com/questions/12499200/balloon-popup-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!