|
-
Apr 3rd, 2011, 11:00 AM
#1
Thread Starter
Member
Problem CheckedListBox
Hello,
So my problem is this. I am inspired by a code on another site, but I understand that. The problem is in this code, to manage a list, the code uses the ListBox, but the disadvantage is that you can select only one box, or I need to select multiple CheckedListBox so I replaced, I am is perfect, BUT I can not update the code. These are the two errors obtained:
Error: "
Code:
Error 3 'Items'is not a member of 'System.Windows.Forms.GroupBox'.
Error 2 'SelectedItem'is not a member of 'System.Windows.Forms.GroupBox'.
Here is the corresponding source code (an example is because there are more lines in the same genre):
Code:
Code:
Me.list_cc.Items.Clear()
Me.list_cc.SelectedItem
How can I get the same effect as 2 functions with CheckedListBox? Many thank you
-
Apr 3rd, 2011, 11:05 AM
#2
Re: Problem CheckedListBox
list_cc is obviously your groupbox + not your CheckedListBox
use the right name + it'll work
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 11:09 AM
#3
Thread Starter
Member
Re: Problem CheckedListBox
Thanks but have you a example , i don't understand
-
Apr 3rd, 2011, 11:13 AM
#4
Re: Problem CheckedListBox
it's basic beginners vb. if you don't understand you should try a tutorial first:
http://www.homeandlearn.co.uk/NET/vbNet.html
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 11:19 AM
#5
Thread Starter
Member
Re: Problem CheckedListBox
Yes but my CheckedListBox's name is list_cc . And i want a fonction in CheckedListBox = Items or SelectedItem'
-
Apr 3rd, 2011, 11:28 AM
#6
Re: Problem CheckedListBox
i can't give you an example because it really isn't clear what you're trying to do.
if you want to upload your project i'll have a look
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 11:32 AM
#7
Thread Starter
Member
Re: Problem CheckedListBox
Yes i want a example please . It's clear but i don't see how do .
-
Apr 3rd, 2011, 11:34 AM
#8
Re: Problem CheckedListBox
please read post #6 again
i said i can't give you an example
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 11:45 AM
#9
Thread Starter
Member
Re: Problem CheckedListBox
Sorry but for my code :
How i can do now ?
-
Apr 3rd, 2011, 11:47 AM
#10
Re: Problem CheckedListBox
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 12:45 PM
#11
Thread Starter
Member
Re: Problem CheckedListBox
This is my code for error error 'SelectedItem' :
VB Code:
If Not Me.list_cc.SelectedItem Is Nothing Then
'Retrouve le film avec ce nom
For Each ccALister As ccinfo In _Listecc
If ccALister.Nom = Me.list_cc.SelectedItem.ToString Then
'L'insère dans une variable globale
Me._ccEnVisualisation = ccALister
End If
Next
End If
This is my code for error error 'Item' :
My code is too long for post
-
Apr 3rd, 2011, 12:48 PM
#12
Re: Problem CheckedListBox
i think we have a language barrier.
we need to see the relevant code if you have any chance of help + if it's all in french, i probably won't be able to help you
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 01:03 PM
#13
Thread Starter
Member
Re: Problem CheckedListBox
Code in english :
Vb Code:
If Not Me.list_cc.SelectedItem Is Nothing Then
'Found the movie with that name
For Each ccALister As ccinfo In _Listecc
If ccALister.Nom = Me.list_cc.SelectedItem.ToString Then
'Inserts in a global variable
Me._ccEnVisualisation = ccALister
End If
Next
End If
-
Apr 3rd, 2011, 02:00 PM
#14
Re: Problem CheckedListBox
that isn't the relevant code
we need to see the lines that are causing the errors
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 02:02 PM
#15
Re: Problem CheckedListBox
also if vb says list_cc is a groupbox it probably is a groupbox
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 02:06 PM
#16
Thread Starter
Member
Re: Problem CheckedListBox
It's the only code for error SelectedItem
Vb Code:
If Not Me.list_cc.SelectedItem Is Nothing Then
'Found the movie with that name
For Each ccALister As ccinfo In _Listecc
If ccALister.Nom = Me.list_cc.SelectedItem.ToString Then
'Inserts in a global variable
Me._ccEnVisualisation = ccALister
End If
Next
End If
The rest is much too long for post . If you explain me the error , i can solve
the error for the rest of the code
-
Apr 3rd, 2011, 02:09 PM
#17
Re: Problem CheckedListBox
in your form designer, click on the list_cc listbox(???) + take a screenshot that shows the selected listbox + the properties window + post it in this thread
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 02:17 PM
#18
Hyperactive Member
Re: Problem CheckedListBox
Like paul said, unless you debug the code and locate the error, we won't be able to know the cause of error. You have something like " .Nom " in your code. What is it ?
-
Apr 3rd, 2011, 03:00 PM
#19
Thread Starter
Member
Re: Problem CheckedListBox
Forget it, thank you but it's too complicated .. By cons how do I select all the boxes. I have this function but it does to selection:
CheckedListBox1.SetItemChecked (0, True)
Seconde question, I have fichier.vb [Design] but i have delet onglet , how I can to re-open this ?
-
Apr 3rd, 2011, 03:26 PM
#20
Re: Problem CheckedListBox
i take it you solved the list_cc problem then?
vb Code:
For x As Integer = 0 To CheckedListBox1.Items.Count - 1
CheckedListBox1.SetItemChecked(x, True)
Next
 Originally Posted by max1395
Seconde question, I have fichier.vb [Design] but i have delet onglet , how I can to re-open this ?
what's that in english?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 03:51 PM
#21
Thread Starter
Member
Re: Problem CheckedListBox
I had a tab Fichier.vb [Design]. But without express I cancel tab, how to restore?
-
Apr 3rd, 2011, 03:54 PM
#22
Re: Problem CheckedListBox
in your designer you have a project explorer window on the right. doubleclick Fichier.vb
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 3rd, 2011, 04:09 PM
#23
Thread Starter
Member
Re: Problem CheckedListBox
Yes of course ^^ Thanks you . Sorry for my bad english .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|