我该如何为这个案例设计申请? [英] How should I design the application for this case?

查看:55
本文介绍了我该如何为这个案例设计申请?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Lang:Visual Basic 2015





我想制作选项面板



对于应用程序的设计,有一个树形视图和一个winform这样的面板



------------- ----

TreeView



- 项目1

- Sub Item1

- Sub_Sub_Item1

- Sub_Sub_Item2

- Sub Item2

- 第2项

- 第3项

-----------------



面板



-----------------



用户选择Treeview的节点和相应的面板显示面板



用户在面板上设置值,如文本框,数据网格视图,控件..



另外在面板上设置值,可以添加Treeview的节点。



我尝试过:



我放置了



winform

Usercontrol对应t o节点



但我无法控制来自Usercontrol的winform。



我想要的知道这是不是正确的方法。



请以有效的方式向我提出建议。

Lang : Visual Basic 2015


I would like make the Option Panel

For the Application's design, there is a treeview and a Panel in winform like this

-----------------
TreeView

- Item 1
- Sub Item1
- Sub_Sub_Item1
- Sub_Sub_Item2
- Sub Item2
- Item 2
- Item 3
-----------------

Panel

-----------------

User Select the Nodes of Treeview and a corresponding panel show on the panel

User Set the value on the panel like textbox, datagridview, controls..

Also by setting the values on the panel, nodes of Treeview can be added.

What I have tried:

I placed

winform
Usercontrol corresponding to Nodes

but I couldn't control winform from Usercontrol.

Thing I'd like to know is that is it right approach or not.

Please advice me on the efficient way.

推荐答案

您不能从UserControl控制窗体 - 您可以在UserControl中引发窗体可以处理的事件以进行更新,就像TextBox引发TextChanged事件以告诉其父窗体它可以验证新数据一样to。

创建事件非常简单:添加活动的简单代码段 [ ^ ]显示代码(并提供自动化方法)。
You don't control a Form from a UserControl - you raise events in the UserControl which the Form can handle to update itself, just as a TextBox raises a TextChanged event to tell its parent Form that it can validate the new data is it wants to.
Creating events is pretty simple: A Simple Code Snippet to Add an Event[^] shows the code (and provides a way to automate it).


这篇关于我该如何为这个案例设计申请?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆