结构内的结构-需要帮助 [英] Structure within structure - Help needed
本文介绍了结构内的结构-需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我能够在vb.net的结构内部创建一个结构,但是对于为内部结构分配值感到困惑.我想将根结构(包含其自身以及内部结构的值)发送给另一个过程. 请有人帮忙.在此先感谢
I am able to create a structure inside a structure in vb.net but i am confused as to assign values to the inner structure. I want to send the root structure (which contains the value of its own as well those of the inner structure) to another procedure. Someone please help. Thanks in advance
于2009年5月27日星期三6:07修改
modified on Wednesday, May 27, 2009 6:07 AM
推荐答案
是这样的吗?
Public Structure InnerStruct<br /> Public InnerTest As String<br />End Structure<br />Public Structure RootStruct<br /> Public Test As String<br /> Public myStruct As InnerStruct<br />End Structure<br /><br />Public Class Form1<br /><br /> Public Sub ShowInnerText(ByVal whatStruct As RootStruct)<br /> MessageBox.Show(whatStruct.myStruct.InnerTest)<br /> End Sub<br /><br /> Private Sub Button1_Click(ByVal sender As System.Object, _<br /> ByVal e As System.EventArgs) Handles Button1.Click<br /><br /> Dim newStruct As RootStruct<br /> newStruct.myStruct.InnerTest = "Hello world"<br /> ShowInnerText(newStruct)<br /><br /> End Sub<br /><br />End Class
这篇关于结构内的结构-需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文