Visual Studio 设计时事件处理
我正在尝试在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要按照此处。有两个演练应该会有所帮助。
最终,您需要在实际按钮之上覆盖一个透明按钮。然后在点击处理程序中,您将更新所选的项目/索引。
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.