Click here to Skip to main content
16,017,297 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i need a code my code is bugy



VB
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

       'check first1 on load
        Dim selectedIndex1 As Integer = CheckedListBox1.SelectedIndex
        selectedIndex1 = 1
        CheckedListBox1.SetItemChecked(selectedIndex1, True)

        ';check first2 on load
        Dim selectedIndex2 As Integer = CheckedListBox2.SelectedIndex
        selectedIndex2 = 1
        CheckedListBox2.SetItemChecked(selectedIndex2, True)
    End Sub




and down i have

VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      


        Dim itemChecked As String

        itemChecked = CheckedListBox1.SelectedItem





        Dim itemChecked2 As String
        itemChecked2 = CheckedListBox2.SelectedItem



        If (CheckedListBox1.SelectedItem <> "") Then
            Dim casuche1 As Object
            For Each casuche1 In CheckedListBox1.CheckedItems
            Next
        Else
            MessageBox.Show("You must select RAM allocated in first form")
            Exit Sub
        End If
        If (CheckedListBox2.SelectedItem <> "") Then
            Dim casuche2 As Object
            For Each casuche2 In CheckedListBox2.CheckedItems
            Next
        Else
            MessageBox.Show("You must select RAM allocated in second form")
            Exit Sub
        End If



        End
    End Sub

   Private Sub CheckedListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckedListBox2.SelectedIndexChanged

        If CheckedListBox2.CheckedItems.Count > 1 Then
            For Each itemChecked2 In CheckedListBox2.CheckedIndices
                CheckedListBox2.SetItemChecked(itemChecked2, False)
            Next
        End If
End Sub
Posted
Comments
[no name] 25-Nov-11 18:04pm    
What have done to debug your buggy code?
What problems are you having?
Sergey Alexandrovich Kryukov 25-Nov-11 18:25pm    
What about "VB", "VB6", etc? It looks like your tags should be "VB.NET, WinForms", nothing else. Please fix it -- this is in your interest.
--SA
Sergey Alexandrovich Kryukov 25-Nov-11 18:26pm    
What's the problem?
--SA

I use the application memory to remember what items i checked
 
Share this answer
 
help me please ?!
WTF nobody wknow how i can make this ?
 
Share this answer
 
Comments
coded007 27-Nov-11 0:47am    
Please tell what need by you ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900