using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
‘Define a variable for intNumber
Dim intNumber As Integer
’Set the initial value
intNumber = 27
‘Add 1 to the value of intNumber
intNumber = intNumber + 1
‘Display the new value of intNumber
MessageBox.Show("Value of intNumber + 1 = " & intNumber.ToString, _
"Variables")
End Sub
}
}
Visual Studio 2010에서이 코드를 실행하고 있으며 많은 오류가 발생합니다. 여기 btnAdd는 버튼의 이름이고 그것을 클릭하면 메시지 상자가 나타납니다. 같은 목적을위한 올바른 코드가 될 것입니다.이 코드는 karli davidson이 작성한 시각적 기본 책입니다.다음 vb.net 코드의 문제점은 무엇입니까?
C#과 VB.NET을 혼합합니다. VB 코드를 C# 프로젝트에 추가했습니다. –