To add code to your project, complete the following steps:
Visual Basic |
Copy Code
|
---|---|
Dim types As Array = [Enum].GetValues(GetType(CodeType)) Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load tbText.Text = "HELLO WORLD!" cbCodeType.DataSource = types cbCodeType.SelectedIndex = Array.IndexOf(types, CodeType.Code39) cbCodeType.Select() End Sub |
C# |
Copy Code
|
---|---|
Array types = Enum.GetValues(typeof(CodeType)); private void Form1_Load(object sender, EventArgs e) { tbText.Text = "HELLO WORLD!"; cbCodeType.DataSource = types; cbCodeType.SelectedIndex = Array.IndexOf(types, CodeType.Code39); cbCodeType.Select(); } |
Visual Basic |
Copy Code
|
---|---|
Private Sub cbCodeType_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbCodeType.SelectedIndexChanged C1BarCode1.CodeType = DirectCast(cbCodeType.SelectedValue, CodeType) End Sub |
C# |
Copy Code
|
---|---|
private void cbCodeType_SelectedIndexChanged(object sender, EventArgs e) { c1BarCode1.CodeType = (CodeType)cbCodeType.SelectedValue; } |
Visual Basic |
Copy Code
|
---|---|
Private Sub tbText_TextChanged(sender As Object, e As EventArgs) Handles tbText.TextChanged C1BarCode1.Text = tbText.Text End Sub |
C# |
Copy Code
|
---|---|
private void tbText_TextChanged(object sender, EventArgs e) { c1BarCode1.Text = tbText.Text; } |
In this step, you added functionality to the controls. In the next step, you will run the project and observe runtime interactions.