amitairoa Posted April 27, 2009 Posted April 27, 2009 Hi! I have a picture in WPF. The picture has words on it. I want that when the user hovers over certain words that I choose, a tooltip will appear with something. How should I do this? Should I draw a rectangle over the words that I want and then access there points through code? Any other ideas? Please help. Thanks a lot! Quote
Administrators PlausiblyDamp Posted April 27, 2009 Administrators Posted April 27, 2009 Do you want the tooltip to appear if the cursor is over the general area of the words or exactly in a point for a letter? If you are just after the general area could you not put a rectangle over the words and put the tooltip on the rectangle? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
amitairoa Posted April 27, 2009 Author Posted April 27, 2009 Do you want the tooltip to appear if the cursor is over the general area of the words or exactly in a point for a letter? If you are just after the general area could you not put a rectangle over the words and put the tooltip on the rectangle? I want the tooltip to appear when the cursor is over a certain word. Quote
Nate Bross Posted April 27, 2009 Posted April 27, 2009 Couldn't you use multiple rectangles per word? Or is the image generated dynamically? Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
amitairoa Posted April 28, 2009 Author Posted April 28, 2009 Couldn't you use multiple rectangles per word? Or is the image generated dynamically? What do you mean? Dynamically? Quote
Nate Bross Posted April 28, 2009 Posted April 28, 2009 Where does your picture come from? Is it static? (exists as a file somewhere) or is it dynamic? (is generated on the fly) If it is static, you should be able to load in a few rectangle objects behind the words in the picture and set the tooltip on the rectangle object. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
amitairoa Posted April 29, 2009 Author Posted April 29, 2009 Where does your picture come from? Is it static? (exists as a file somewhere) or is it dynamic? (is generated on the fly) If it is static, you should be able to load in a few rectangle objects behind the words in the picture and set the tooltip on the rectangle object. It's static. So, do you think I should draw rectangles(hidden) on the words I want and then access the points from code? Could you please tell me how to do this in WPF? Thanks! Quote
amitairoa Posted May 3, 2009 Author Posted May 3, 2009 Hi! After adding the rectangle around the word, how can I determine if the mouse is inside the rectangle from code? In WPF of course... Please help. Thanks! Quote
Administrators PlausiblyDamp Posted May 3, 2009 Administrators Posted May 3, 2009 The rectangle has MouseEnter / MouseLeave events, these will let you know if the mouse is over the rectangle. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.