Home > Net >  VB.net Structure Structure problem
VB.net Structure Structure problem

Time:10-12

///////////modules code///////
Public Structure OtherlblName_ST
Public Buf_Name () as string
Public BufNumber as integer
End Structure

Public Buf_Unit (8) as OtherlblName_ST

Buf_Unit (1). Buf_Name (1)="batch56
"
//////////window code//////////
Label1. Text=Buf_Unit (1). Buf_Name (1)

Please which god gives directions need to complement what code

CodePudding user response:

You're going to do,

CodePudding user response:

You need to do,

Help you translated into c #

The code below

///////////modules code///////
Public struct OtherlblName_ST
{
Public string Buf_Name [];
Public int BufNumber;
}

Public OtherlblName_ST [] Buf_Unit=new OtherlblName_ST [8].

Buf_Unit [0]. Buf_Name [0]="batch56;

//////////window code//////////
Label1. Text=Buf_Unit [0]. Buf_Name [0];

CodePudding user response:

The revised code:


 public struct OtherlblName_ST 
{
Public string [] Buf_Name;
Public int BufNumber;
}

Public OtherlblName_ST [] Buf_Unit=new OtherlblName_ST [8].

Public void Sub ()
{
Buf_Unit [0]. Buf_Name [0]="batch56";

//////////window code//////////
Label1. Text=Buf_Unit [0]. Buf_Name [0];
}

CodePudding user response:

Used in VB6.0 by use of the
The Module code//////
The Public Type OtherlblName
Buf_Name (5) As String
Buf_Number As Integer
End Type

Public Other_Unit (8) As OtherlblName
Public sub Buf_Str_Data_TSF ()
Dim As Integer I
Dim j As Intege
For I=1 to 8
For j=1 to 5
Other_Unit (I). Buf_Name (j)="bath"
Next j
Next I
End sub

Window code

Private Sub Form_Load ()
Call Buf_Str_Data_TSF ()
Label1. Caption=Other_Unit (I). Buf_Name (j)
End Sub

Now want to use the software, VS2015 rewrite, want to use the above way
  • Related