5

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:

enter image description here

Dan McClain
  • 11,310
  • 9
  • 44
  • 67
Nick
  • 9,515
  • 17
  • 75
  • 175
  • possible duplicate of [How to implement Balloon message in a WPF application](http://stackoverflow.com/questions/2310102/how-to-implement-balloon-message-in-a-wpf-application) – Reed Copsey Sep 19 '12 at 16:47
  • 1
    @ReedCopsey no answers in your link... – Nick Sep 19 '12 at 16:55
  • There actually are - all of them are valid, but there is an accepted answer there, too (it's just not listed first, as it's the OP's solution) – Reed Copsey Sep 19 '12 at 16:56
  • 2
    @ReedCopsey but it is not the answer to the question, that answer does not explains how to do a balloon popup, have you tried it? – Nick Sep 19 '12 at 16:59

2 Answers2

2

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>
David Basarab
  • 67,994
  • 42
  • 125
  • 155
  • 1
    your tooltip is rectangular, i need a **balloon**. – Nick Sep 19 '12 at 16:51
  • @Nick You can style it to be what you want. What I was showing you is how you could do it. With the ToolTip content you can make it anything you want, a picture if you want. – David Basarab Sep 19 '12 at 17:29
  • 1
    @Nick The ToolTip can be styled to look however you want. In your case, you'll probably need a `Path` element to draw the balloon outline in the shape you're looking for, and possibly a drop shadow effect. – Rachel Sep 19 '12 at 19:00
1

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

Community
  • 1
  • 1
Freeman
  • 5,281
  • 3
  • 25
  • 40