c# - 气球弹出 WPF

标签 c# wpf popup tooltip popup-balloons

我需要显示一个气球弹出窗口。 WPF 中是否有用于此类工作的控件? 类似于以下内容:

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

这是可能的结果:

enter image description here

最佳答案

您想做一个 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>

关于c# - 气球弹出 WPF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12499200/

相关文章:

c# - OxyPlot 实时数据系列绘图中的自动滚动/ Pane

c# - http ://schemas. microsoft.com/winfx/2006/xaml/presentation 定义

c# - WPF - MVVM DataTemplate 加载到内存以供重用

c# - WPF DragDrop.Give Feedback 不连续发射

C# 检查泛型接口(interface)的实现

c# - 如何通过 Unity 容器配置 HttpClient?

WPF TreeView 不显示箭头

c# - 如何在更改方向时更改网格布局

javascript - 单击页面加载时的 HTML 按钮/链接

javascript - 仅在弹出窗口启动后打印 Javascript