I'm trying to position my tb:TaskbarIcon.TrayToolTip using NotifyIcon.WPF module. http://www.hardcodet.net/wpf-notifyicon

I made sample code Described below. This Code is based on sample code in https://www.codeproject.com/Articles/36468/WPF-NotifyIcon-2.

How to position tb:TaskbarIcon.TrayToolTip Upper Right(User's Position)?

I can't find Placement Property in tb:TaskbarIcon.TrayToolTip.

Please tell me how to deal with this problem.

Mainwindow.xaml


        <tb:TaskbarIcon
            x:Name="MyNotifyIcon"
            IconSource="/Icons/Error.ico"
            PreviewTrayContextMenuOpen="MyNotifyIcon_PreviewTrayContextMenuOpen"
            ToolTipText="aaaaaaaaaaa"
            TrayContextMenuOpen="MyNotifyIcon_TrayContextMenuOpen">

            <tb:TaskbarIcon.TrayToolTip>



                <Border
                    Width="160"
                    Height="40"
                    Background="Black"
                    BorderBrush="Red"
                    BorderThickness="2"
                    CornerRadius="4"
                    Opacity="0.8">
                    <TextBlock
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        FontSize="15"
                        Foreground="White"
                        Text="hello world" />
                </Border>
            </tb:TaskbarIcon.TrayToolTip>




            <!--  Set a simple context menu  -->
            <!--  the data context of the context menu is the NotifyIcon itself (see more about this in DataBinding samples)  -->


        </tb:TaskbarIcon>





0 Answers