如何在wpf中单击按钮添加用户控件

编程入门 行业动态 更新时间:2024-10-26 00:27:28
本文介绍了如何在wpf中单击按钮添加用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好, 我在主窗口中有一个项目列表,我有一个用户控件。这些是与每个项目相关的一些值或字段在list.i中需要显示与数据网格中列表中每个项目相关的字段,因为我选择了每个项目。我只需要在列表中选择的项目内容。选择下一个项目相关的项目时这必须从网格中消失。依此类推。怎么办呢?任何人都有任何想法。 请帮帮我

Hello, I have a list of items in the main window and i have a user control.Thers is some Values or fields related to each of the items in the list.i need to show the fields related to each item in the list on a data grid as i select each item.I need to have only the contents of items that i selected on the list.When selecting next item fields related to this must be gone from grid.and so on.How can it be done?Anyone have any idea. please help me

推荐答案

请找到代码。 Please find the code. UserControl userControl = new UCTeamTweet(); userControl.Width = Convert.ToInt32("500"); userControl.Height = Convert.ToInt32("900"); userControl.HorizontalAlignment = HorizontalAlignment.Left; userControl.VerticalAlignment = VerticalAlignment.Top; stkPnlSearch.Children.Add(userControl); // Add to the stack panel.

在button_click事件中执行此操作。

Perform this action inside button_click event.

更多推荐

如何在wpf中单击按钮添加用户控件

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

发布评论

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

>www.elefans.com

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