在使用方便的转换器将C#转换为VB后,缺少一行代码。显然,表单加载语法使转换器感到非常困惑,甚至连试都不试。我没有任何幸运的找到正确的VB等价物,也不能让Form1_Load sub运行。我们将非常感谢你的帮助。
C#:
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1121, 890);
this.Controls.Add(this.vcGantt1);
this.Name = "Form1";
this.Text = "NETRONIC VARCHART XGantt - Tutorial Project 1";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);缺少行的VB:
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1495, 1095)
Me.Controls.Add(Me.vcGantt1)
Me.Margin = New System.Windows.Forms.Padding(4)
Me.Name = "Form1"
Me.Text = "NETRONIC VARCHART XGantt - Tutorial Project 1"
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
Me.ResumeLayout(False)非常感谢!
发布于 2021-04-28 23:43:54
在Form1_Load的末尾添加一个句柄MyBase.Load,如下所示:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' ... your code goes here
End Subhttps://stackoverflow.com/questions/67292041
复制相似问题