Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Error Help

Error Help

Scheduled Pinned Locked Moved WPF
wpfhelpcsharplearning
10 Posts 2 Posters 21 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jammer 0
    wrote on last edited by
    #1

    Hi All, I'm just adding in ToolTips to a chart I'm building in WPF. The TargetType is set to {x:Type ToolTip} and the style definition is placed in the section of the XAML. Running the application and navigating to the screen with the chart in works ok (no compile error) but the tooltip is not styled as per the definition. Going into Blend and looking at the UserContol is ok but when I click on the [Edit Resource] button for [System.Windows.Controls.ToolTip] resource I get the following error: 'ToolTip' cannot have a logical or visual parent. Any ideas would be great.

    Jammer Going where everyone here has gone before! :) My Blog

    L 1 Reply Last reply
    0
    • J Jammer 0

      Hi All, I'm just adding in ToolTips to a chart I'm building in WPF. The TargetType is set to {x:Type ToolTip} and the style definition is placed in the section of the XAML. Running the application and navigating to the screen with the chart in works ok (no compile error) but the tooltip is not styled as per the definition. Going into Blend and looking at the UserContol is ok but when I click on the [Edit Resource] button for [System.Windows.Controls.ToolTip] resource I get the following error: 'ToolTip' cannot have a logical or visual parent. Any ideas would be great.

      Jammer Going where everyone here has gone before! :) My Blog

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Can you post the XAML?

      Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

      Just a grain of sand on the worlds beaches.

      J 1 Reply Last reply
      0
      • L Lost User

        Can you post the XAML?

        Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

        Just a grain of sand on the worlds beaches.

        J Offline
        J Offline
        Jammer 0
        wrote on last edited by
        #3

        Hi Karl, <Setter Property="Background" Value="#FF0000" /> <Setter Property="FontFamily" Value="Segoe UI" /> <Setter Property="FontSize" Value="12" /> <Setter Property="FontWeight" Value="Normal" /> <Setter Property="Foreground" Value="#FFFFFF" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToolTip}"> <Border CornerRadius="4" Background="Transparent"> <ContentPresenter Margin="6,4,6,4" /> </Border> </ControlTemplate> </Setter.Value> </Setter>

        L 1 Reply Last reply
        0
        • J Jammer 0

          Hi Karl, <Setter Property="Background" Value="#FF0000" /> <Setter Property="FontFamily" Value="Segoe UI" /> <Setter Property="FontSize" Value="12" /> <Setter Property="FontWeight" Value="Normal" /> <Setter Property="Foreground" Value="#FFFFFF" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToolTip}"> <Border CornerRadius="4" Background="Transparent"> <ContentPresenter Margin="6,4,6,4" /> </Border> </ControlTemplate> </Setter.Value> </Setter>

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Jammer, Take a close look at the colors. I added the alpha channel to each of your hex colors. The Background of the Border was Transparent, I made it Black and the ToolTip now shows up. Not sure why Blend blows up. I'm using Blend 2.5, got the same thing. I would send your example to the Blend team. The below template works fine and shows the tooltip at run-time.

              <UserControl.Resources>
                  <!-- ToolTip Style -->
                  <Style TargetType="{x:Type ToolTip}">
                        <Setter Property="Background" Value="#FF000000" />
                        <Setter Property="FontFamily" Value="Segoe UI" />
                        <Setter Property="FontSize" Value="12" />
                        <Setter Property="FontWeight" Value="Normal" />
                        <Setter Property="Foreground" Value="#FFFFFFFF" />			
                        <Setter Property="Template">
                              <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type ToolTip}">
                                          <Border CornerRadius="4" Background="#FF000000" >
                                                <ContentPresenter />
                                          </Border>
                                    </ControlTemplate>
                              </Setter.Value>
                        </Setter>
                  </Style>
              </UserControl.Resources>
          

          Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

          Just a grain of sand on the worlds beaches.

          J 3 Replies Last reply
          0
          • L Lost User

            Jammer, Take a close look at the colors. I added the alpha channel to each of your hex colors. The Background of the Border was Transparent, I made it Black and the ToolTip now shows up. Not sure why Blend blows up. I'm using Blend 2.5, got the same thing. I would send your example to the Blend team. The below template works fine and shows the tooltip at run-time.

                <UserControl.Resources>
                    <!-- ToolTip Style -->
                    <Style TargetType="{x:Type ToolTip}">
                          <Setter Property="Background" Value="#FF000000" />
                          <Setter Property="FontFamily" Value="Segoe UI" />
                          <Setter Property="FontSize" Value="12" />
                          <Setter Property="FontWeight" Value="Normal" />
                          <Setter Property="Foreground" Value="#FFFFFFFF" />			
                          <Setter Property="Template">
                                <Setter.Value>
                                      <ControlTemplate TargetType="{x:Type ToolTip}">
                                            <Border CornerRadius="4" Background="#FF000000" >
                                                  <ContentPresenter />
                                            </Border>
                                      </ControlTemplate>
                                </Setter.Value>
                          </Setter>
                    </Style>
                </UserControl.Resources>
            

            Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

            Just a grain of sand on the worlds beaches.

            J Offline
            J Offline
            Jammer 0
            wrote on last edited by
            #5

            Ahhh, ok. I've just amended my code to reflect the changes you detail and my ToolTip still isn't applying the styling. My tooltip was always showing up just not with the style template applied to the tooltip. This is really frustrating at the moment. Thanks for the tips ... will keep on trying to get this working. I'm kida running out of time trying to get a simple tooltip running properly! feck! :)

            Jammer Going where everyone here has gone before! :) My Blog

            1 Reply Last reply
            0
            • L Lost User

              Jammer, Take a close look at the colors. I added the alpha channel to each of your hex colors. The Background of the Border was Transparent, I made it Black and the ToolTip now shows up. Not sure why Blend blows up. I'm using Blend 2.5, got the same thing. I would send your example to the Blend team. The below template works fine and shows the tooltip at run-time.

                  <UserControl.Resources>
                      <!-- ToolTip Style -->
                      <Style TargetType="{x:Type ToolTip}">
                            <Setter Property="Background" Value="#FF000000" />
                            <Setter Property="FontFamily" Value="Segoe UI" />
                            <Setter Property="FontSize" Value="12" />
                            <Setter Property="FontWeight" Value="Normal" />
                            <Setter Property="Foreground" Value="#FFFFFFFF" />			
                            <Setter Property="Template">
                                  <Setter.Value>
                                        <ControlTemplate TargetType="{x:Type ToolTip}">
                                              <Border CornerRadius="4" Background="#FF000000" >
                                                    <ContentPresenter />
                                              </Border>
                                        </ControlTemplate>
                                  </Setter.Value>
                            </Setter>
                      </Style>
                  </UserControl.Resources>
              

              Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

              Just a grain of sand on the worlds beaches.

              J Offline
              J Offline
              Jammer 0
              wrote on last edited by
              #6

              I'm thinking that the error blend is throwing is the reason why this style doesn't get applied at run-time ... I've also tried moving this ToolTip definition into my applications main dictionary xaml file and its still ignored ...

              Jammer Going where everyone here has gone before! :) My Blog

              1 Reply Last reply
              0
              • L Lost User

                Jammer, Take a close look at the colors. I added the alpha channel to each of your hex colors. The Background of the Border was Transparent, I made it Black and the ToolTip now shows up. Not sure why Blend blows up. I'm using Blend 2.5, got the same thing. I would send your example to the Blend team. The below template works fine and shows the tooltip at run-time.

                    <UserControl.Resources>
                        <!-- ToolTip Style -->
                        <Style TargetType="{x:Type ToolTip}">
                              <Setter Property="Background" Value="#FF000000" />
                              <Setter Property="FontFamily" Value="Segoe UI" />
                              <Setter Property="FontSize" Value="12" />
                              <Setter Property="FontWeight" Value="Normal" />
                              <Setter Property="Foreground" Value="#FFFFFFFF" />			
                              <Setter Property="Template">
                                    <Setter.Value>
                                          <ControlTemplate TargetType="{x:Type ToolTip}">
                                                <Border CornerRadius="4" Background="#FF000000" >
                                                      <ContentPresenter />
                                                </Border>
                                          </ControlTemplate>
                                    </Setter.Value>
                              </Setter>
                        </Style>
                    </UserControl.Resources>
                

                Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                Just a grain of sand on the worlds beaches.

                J Offline
                J Offline
                Jammer 0
                wrote on last edited by
                #7

                Hi Karl, Any ideas on this? All I can get my tooltip to do is this: http://www.jammer.biz/images/wpf/tooltip.png[^] Its just completely ignoring the style. From looking at examples on the web I'm doing *exactly* the same thing (but in a usercontrol) and its failing to style ... I just can't work this out at all. Could it be a settings conflict in the xaml? Maybe something in my dictionary is conflicting? Would that be highlighted at compile time?

                Jammer Going where everyone here has gone before! :) My Blog

                L 1 Reply Last reply
                0
                • J Jammer 0

                  Hi Karl, Any ideas on this? All I can get my tooltip to do is this: http://www.jammer.biz/images/wpf/tooltip.png[^] Its just completely ignoring the style. From looking at examples on the web I'm doing *exactly* the same thing (but in a usercontrol) and its failing to style ... I just can't work this out at all. Could it be a settings conflict in the xaml? Maybe something in my dictionary is conflicting? Would that be highlighted at compile time?

                  Jammer Going where everyone here has gone before! :) My Blog

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Just not sure. That tooltip I sent worked fine in a quick application I did. Is the Infragistics control styling the ToolTip? Break out Mole or Snoop and see if they have styled the ToolTip. If they style the ToolTip, it will override your styling. You can also post on Infragistics Support forum and see what they say.

                  Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                  Just a grain of sand on the worlds beaches.

                  J 2 Replies Last reply
                  0
                  • L Lost User

                    Just not sure. That tooltip I sent worked fine in a quick application I did. Is the Infragistics control styling the ToolTip? Break out Mole or Snoop and see if they have styled the ToolTip. If they style the ToolTip, it will override your styling. You can also post on Infragistics Support forum and see what they say.

                    Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                    Just a grain of sand on the worlds beaches.

                    J Offline
                    J Offline
                    Jammer 0
                    wrote on last edited by
                    #9

                    Indeed ... the style code works as designed. I added it into the default dictionary for the application and its styling every other tooltip in the interface as expected. And some of those are in other usercontrols so that's not the issue. I'm going to delve in with mole tomorrow and investigate some more. I have a priority support contract with Infragistics and I've emailed them to query this as well. The Infragistics stuff is really great. Odd little problem I have here I think!

                    Jammer Going where everyone here has gone before! :) My Blog

                    1 Reply Last reply
                    0
                    • L Lost User

                      Just not sure. That tooltip I sent worked fine in a quick application I did. Is the Infragistics control styling the ToolTip? Break out Mole or Snoop and see if they have styled the ToolTip. If they style the ToolTip, it will override your styling. You can also post on Infragistics Support forum and see what they say.

                      Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                      Just a grain of sand on the worlds beaches.

                      J Offline
                      J Offline
                      Jammer 0
                      wrote on last edited by
                      #10

                      Its been tracked down to some odd behaviour with the 3D chart. What I'm seeing isn't a tooltip ... its a textblock!

                      Jammer Going where everyone here has gone before! :) My Blog

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups