单击Silverlight源按钮需要帮助.

编程入门 行业动态 更新时间:2024-10-27 16:36:17
本文介绍了单击Silverlight源按钮需要帮助.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我有一个Silverlight应用程序,我有两个窗口,第一个窗口是父窗口,其中有几个按钮,现在其中两个打开了一个窗口供我搜索,现在我需要的是如何从中知道单击按钮后的第二个窗口,我如何找出按下了哪个按钮? 在此先谢谢您, Ram.

Hi everyone, I have a silverlight app and i have two windows, first window is the parent and i have a few buttons in it, now two of them open the same window where i do a search, now for what i need is how can i know from the second window after the button click, how do i find out which button was pressed? Thanks in advanced, Ram.

推荐答案

您只需为第二个窗口添加构造函数,即可在其中传递参数以标识单击的按钮,它可以是一个按钮.属性,甚至整个按钮对象(但这不是有效的方法. You can simply add the constructor for second window, in which you''ll pass the parameter to identify clicked button, it could be a button.Tag property, or even the whole button object (but it would be not efficient way. private Button_Click(object sender, RoutedEventArgs e) { Button button = sender as Button; if(button!=null) { Window2 window = new Window2(button.Tag); } else { Window2 window = new Window2(); } }

更多推荐

单击Silverlight源按钮需要帮助.

本文发布于:2023-07-11 11:55:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1093964.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单击   按钮   Silverlight

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!