Click here to Skip to main content
13,090,730 members (43,637 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
i need a code my code is bugy



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

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 25-Nov-11 11:24am
Comments
Mark Nischalke 25-Nov-11 18:04pm
   
What have done to debug your buggy code?
What problems are you having?
SAKryukov 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
SAKryukov 25-Nov-11 18:26pm
   
What's the problem?
--SA
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

help me please ?!
WTF nobody wknow how i can make this ?
  Permalink  
Comments
coded007 27-Nov-11 0:47am
   
Please tell what need by you ?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

I use the application memory to remember what items i checked
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100