本文介绍了如何在一个项目中将表单作为另一个项目中的子项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在vb.net的一个单独项目中开发了一个带有启动表单的报告模块。之后我创建了一个带有midi父级的新vb.net win表单项目。我想打电话给现有的报告程序,让它作为一个孩子打开到neparent。
在VB6中,我有一些例程,可以让我设置父属性单独项目中的表格。
在vb.net中是否有类似内容?
我尝试了什么:
在VB6代码中我有;
I developed a reporting module with a startup form in a separate project in vb.net. I have since created a new vb.net win form project with a midi parent. I would like to call the existing report program and have it open as a child to the neparent.
In VB6 I had routines that would let me set the parent attribute in a form in a separate project.
Is there something similar in vb.net?
What I have tried:
In the VB6 code I have;
Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
例程
routines
Public Function fun_ParentHwnd(Optional nHwnd As Long, Optional bClear As Boolean) As Long
Dim n As Long
'Read registry setting for ParentHwnd from Parent form
n = GetCUSetting("", "ParentHwnd", 0)
fun_ParentHwnd = n
End Function
Sub MakeMeChild(nHwnd As Long)
Dim nRet As Long
UBhWnd = fun_ParentHwnd
nRet = SetParent(nHwnd, UBhWnd)
UBhWnd = ubHandle
End Sub
推荐答案
这篇关于如何在一个项目中将表单作为另一个项目中的子项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!