开发者

How to make "mouse-transparent" panel?

I'm new to WPF so I've got a problem:

I need to create a grid. This grid should contain a column with a kind of thumbnails. When I move mouse over a thumbnail, there should appear a panel with a big image. This panel will cover all grid. Bu开发者_开发技巧t this will make thumbnail think that mouse already has gone. After mouse's gone, panel should dissappear. Mouse appears above thumb again, and panel appears. And again, and again. I don't know how to handle this. Could anybody suggest any solution?


Sounds to me like you want to use IsHitTestVisible="False" on the image that pops up. This will make it ignore the popup when testing where the mouse is, so it will think your mouse is still over the thumbnail image. This should work on any UI element, except windows.


Use MouseEnter and MouseLeave:

http://www.hanselman.com/blog/MouseEnterAndMouseLeaveLoopsInWPF.aspx


There are two ways I can think of to do this, depending on what kind of functionality you're looking for.

If you want the larger image to appear in proximity to the mouse and the thumbnail, then you might want to take a look at using a Tooltip.

Otherwise as Aliostad mentioned above, you could use the MouseEnter and MouseLeave events to trigger the display of whatever content is needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜