Greeting Reddit,
I’m attempting to write an inventory/ordering system for the go kart place that I’m the head mechanic at. I’ve dabbled in c# wpf projects before but can’t seem to find a google result that matches what I’m looking for. All I get is how to show an image inside a tooltip. We have a parts manual which I’ve converted to individual image files and labeled accordingly. It has callouts for the item number with arrows and I want to be able to hover over those numbers and get a tooltip with the info of that part.
How do I essentially make a set of coordinates for tooltips for each page easily and efficiently? Here’s a screenshot of what I’ve got so far: Screenshot
EDIT: I think I have found a janky way to kinda accomplish this by using tabs and a bunch of invisible buttons and assigning the info to the tool tip in each buttons properties but it’s slow to fill in and I want to be able to show other data than just the part name and number. My hope is to use json files for each “chapter” with each part having sections for name, part number, price, etc. I want to also use this to make orders faster by clicking on the numbers and adding that to a list. I’ve somewhat accomplished that but it’s by getting the tooltip text and putting it in a list box but I can’t put that in a chart with all the other related data I want for that part.
This is done with image maps in HTML. You declare a path that encloses the area you wish to convert into a hotspot, and treat it more or less like a button by attaching mouse events to it.
Look for ways to implement image maps using WPF.
Just throwing in another possible solution: you could change the tooltip of the whole image depending on where the mouse is before the tooltip is showing.
You can store the ranges (ideally mapped from 0 to 1)in an array and get the one you need before the tooltip shows (to prevent thousands of mouse movement events wasting resources)
Probably better to custom draw the tooltip over the image.
WPF tool tips are basically a special case of WPF popups, and given that you want a bunch of behaviors that regular tool tips don’t have, this may be a more flexible approach.
That said… you basically have to define regions in the image anyway. I wonder if you couldn’t make those Path instances, which can be polygons, etc., make their stoke and fill zero, and give them a tooltip?
C# devs
null reference exceptions