VB.net Structure结构问题

qclymeng 2019-07-14 04:36:31
///////////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” //////////窗口代码////////// Label1.text = Buf_Unit(1).Buf_Name(1) 请哪位大神指点一下需要补充哪些代码
...全文
122 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qclymeng 2019-07-16
  • 打赏
  • 举报
回复
以前VB6.0中使的 Module code////// 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 i As Integer 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 窗口代码 Private Sub Form_Load() call Buf_Str_Data_TSF() Label1.Caption = Other_Unit(i).Buf_Name(j) End Sub 现在软件想用VS2015重新写,想运用上面的方式
XBodhi. 2019-07-15
  • 打赏
  • 举报
回复
修正后的代码:


        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";

//////////窗口代码//////////
Label1.text = Buf_Unit[0].Buf_Name[0];
}
XBodhi. 2019-07-15
  • 打赏
  • 举报
回复
你需要 做什么,

帮你翻译成 c# 吗

代码如下

///////////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;

//////////窗口代码//////////
Label1.text = Buf_Unit[0].Buf_Name[0];

ruhong1 2019-07-15
  • 打赏
  • 举报
回复
你是要干啥。

16,721

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧