Visual Studio 设计时事件处理

发布于 2024-08-10 02:32:31 字数 244 浏览 2 评论 0原文

我正在尝试在 Visual Studio 中创建 WPF 向导控件。我很成功,只是我想在设计时通过单击下一个和上一个按钮来导航页面。这些页面是用 xaml 编写的。我可以通过转到属性窗口并更改所选索引来导航页面,但我想要更用户友好的东西。我记得在 winforms 项目中做了类似的事情,与重写 wndproc 和监听设计器的鼠标单击事件有关。

所以我一直在谷歌上搜索,但我似乎无法在谷歌上搜索到正确的词来提出这个问题。

任何人都可以帮忙吗!

I am trying to create a WPF wizard control in visual studio. I am successful except I would like to navigate the pages in design time by clicking the next and previous buttons. The pages are being written in xaml. I can navigate the pages by going to the properties window and changing the selected index, but I would like something more user-friendly. I remember doing something similar in a winforms project having something to do with overriding maybe wndproc and listening to mouse click events from the designer.

So I've been googling and I can't seem to google the right words to bring this up.

Can anyone please help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寻找一个思念的角度 2024-08-17 02:32:31

您需要按照此处。有两个演练应该会有所帮助。

最终,您需要在实际按钮之上覆盖一个透明按钮。然后在点击处理程序中,您将更新所选的项目/索引。

You need to create a custom Adorner as described here. There are two walkthroughs there that should help.

Ultimately, you would need to overlay a transparent button on top of your actual buttons. Then in the click handlers you'd update your selected item/index.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文