需要将groupbox从一种形式显示到另一种形式 [英] need to display groupbox from one form to another

查看:76
本文介绍了需要将groupbox从一种形式显示到另一种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在form3的groupbox中显示form5的groupbox才能得到任何人的帮助!我已经浏览过 每个地方,但我没有得到....请帮助我..请给我这个问题的vb.net代码

i need to display groupbox of form5 in groupbox of form3 can i get a favour from anyone please!!! i have browsed  every where but i didn't get....please help me..please get me vb.net code for this problem

推荐答案

你能解释一下你为什么要这样做吗?该计划的预期效果是什么?也许您真正需要做的是创建一个自定义用户控件并使用它的两个单独的实例。

Can you explain why you want to do this? What is the intended effect in the program? Perhaps what you really need to do is create a custom user control and use two separate instances of it.

您可以将组合框从一个表单移动到另一个表单,但您必须考虑任何与该组框中的控件一起使用的代码。 移动控件是一回事,但提供在两个表单上与它们交互的代码将需要
更多的工作。

You can move the groupbox from one form to another, but you have to take into consideration any code that works with the controls in that groupbox.  Moving the controls is one thing, but providing code to interact with them on both forms will require more work.

假设Form3引用Form5,您只需删除groupbox从一个控件集合中将其添加到另一个控件集合中。

Assuming Form3 has a reference to Form5 you can simply remove the groupbox from one control collection and add it to the other.

Private Sub Form3_SomeEvent(sender As Object, e as EventArgs)
   Dim form5GroupBox = form5Instance.GroupBox1
   form5Instance.Controls.Remove(form5GroupBox )
   Me.GroupBox1.Controls.Add(form5GroupBox)
End Sub


这篇关于需要将groupbox从一种形式显示到另一种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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