What's new

Closed Mga kuya pa help nmn New in programing

Status
Not open for further replies.

junee31

Enthusiast
Joined
Nov 29, 2015
Posts
5
Reaction
0
Points
62
Pa help nmn poh dko malagyan ng Value ung combo box iba ung lumalabas

Public Class Form1
Dim y As String
Dim cat As Integer
Dim value As Integer

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("1")
ComboBox1.Items.Add("2")
ComboBox1.Items.Add("3")
ComboBox1.Items.Add("4")
ComboBox1.Items.Add("5")
ComboBox1.Items.Add("6")
ComboBox1.Items.Add("7")
ComboBox1.Items.Add("8")
ComboBox1.Items.Add("9")
ComboBox1.Items.Add("10")
ComboBox2.Items.Add("cat")
ComboBox2.Items.Add("dog")
ComboBox2.Items.Add("Mike Gold")
ComboBox2.Items.Add("Praveen Kumar")
ComboBox2.Items.Add("Raj Beniwal")
ComboBox2.Items.Add("wow")
y = ComboBox2.SelectedItem
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
If y = "cat" Then
value = "300"
End If

If y = "dog" Then
value = "250"
End If

If ComboBox1.SelectedIndex > -1 Then
TextBox1.Text = CStr(ComboBox1.SelectedItem)
End If
If ComboBox2.SelectedIndex > -1 Then
TextBox2.Text = CStr(ComboBox2.SelectedItem)
End If
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox3.Text = TextBox1.Text * TextBox2.Text

End Sub
End Class


ccc.png

dko lng alam bkt lumalabas ung Dog sa price Any idea poh pls
 
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged

If ComboBox1.SelectedIndex > -1 Then
TextBox1.Text = CStr(ComboBox1.SelectedItem)
End If
If ComboBox2.SelectedIndex > -1 Then
y= CStr(ComboBox2.SelectedItem)
End If

If y = "cat" Then
value = "300"
End If

If y = "dog" Then
value = "250"
End If
TextBox2.Text = value
End Sub

Dapat ganito ito, mahuhuli yung conversion ng cat and dog to 300 and 250 respectively.
 
Status
Not open for further replies.

Similar threads

Back
Top