sir patulong naman po :0
pa Help naman po sa mga expert jan sa Visual Basic gamit po ang Visual Studio. Meron po kasi akong Project, Input po game name tapos merong listbox dun mastore ung name tapos kapg click lalabas ung description nung game sa output box. meron din po dapat pre loaded na gme ung listbox. meron po akong code kaso di ko po lam kung bakit wala description na lumalabas.okay na po ung delete at add button ko. description, find at update button po problema. salamat po sa makakatulong. eto po code.
lass MainWindow
Dim list1 As New Dictionary(Of String, String)
Private games As Object
Sub Output(ByVal Value As String)
txtgameDec.Text += Value + vbCrLf
txtgameDec.Text = listBox.SelectedItem.Value
End Sub
Sub Output1(ByVal Value As String)
txtgameName.Text += Value + vbCrLf
End Sub
Private Sub btnAdd_Click(sender As Object, e As RoutedEventArgs) Handles btnAdd.Click
listBox.Items.Add(txtInput.Text)
End Sub
Private Sub btnDel_Click_1(sender As Object, e As RoutedEventArgs) Handles btnDel.Click
listBox.Items.Remove(listBox.SelectedItem)
End Sub
Private Sub listBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles listBox.SelectionChanged
Dim cnt As Integer = listBox.Items.IndexOf(listBox.SelectedItem)
For ctr = 0 To listBox.SelectedItems.Count - 1
If (listBox.Items(ctr)) = listBox.SelectedItem Then
Output1(games.Keys(ctr))
Output(games.Values(ctr))
End If
Next
End Sub
Sub Window_Loaded()
listBox.Items.Add("Counter Strike")
list1.Add("Counter Strike", "Barilan")
End Sub
End Class
Eto naman po XAML nung design nung Form ko.
<Grid Background="#FFE41E1E" Margin="0,0,3.2,-1.8">
<Grid.RowDefinitions>
<RowDefinition Height="184*"/>
<RowDefinition Height="11*"/>
</Grid.RowDefinitions>
<Label Content="Search:" Height="28" HorizontalAlignment="Left" Margin="26,10,0,0" Name="Label1" VerticalAlignment="Top" Width="48" />
<Button Content="Find..." Height="28" HorizontalAlignment="Left" Margin="419,12,0,0" Name="btnFind" VerticalAlignment="Top" Width="152" />
<TextBox Height="19" HorizontalAlignment="Left" Margin="95,12,0,0" x:Name="txtInput" VerticalAlignment="Top" Width="298" />
<Button Content="Add" Height="23" HorizontalAlignment="Left" Margin="420,54,0,0" x:Name="btnAdd" VerticalAlignment="Top" Width="44" />
<Button Content="Update" Height="23" HorizontalAlignment="Left" Margin="472,54,0,0" Name="btnUpdate" VerticalAlignment="Top" Width="50" />
<Button Content="Del" Height="23" HorizontalAlignment="Left" Margin="527,54,0,0" x:Name="btnDel" VerticalAlignment="Top" Width="45" />
<TextBox x:Name="txtgameName" Height="39" HorizontalAlignment="Left" Margin="95,40,0,0" VerticalAlignment="Top" Width="298" />
<TextBox Height="280" HorizontalAlignment="Left" Margin="95,122,0,0" x:Name="txtgameDec" VerticalAlignment="Top" Width="298" />
<ListBox x:Name="listBox" HorizontalAlignment="Left" Height="280" Margin="420,122,0,0" VerticalAlignment="Top" Width="151" FontFamily="Showcard Gothic">
<ListBoxItem FontFamily="Lucida Bright"/>
</ListBox>
<Label x:Name="Label3" Content="List of Games:" HorizontalAlignment="Left" Margin="421,84,0,0" VerticalAlignment="Top" Width="151" FontSize="21.333"/>
<Label x:Name="Label2" Content="Description:" HorizontalAlignment="Left" Margin="95,84,0,0" VerticalAlignment="Top" Width="298" FontSize="21.333"/>
</Grid>
eto po ung sample result:
View attachment 286091