473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[VB.net] - Checkbox and CheckedListbox

79
Hello,

i'm in a bit of problem here :(

I've been using Checkboxes on my app - but it has been horrible, since my app has alot of checkboxes - over 20-30.

But i decided to use checkedlistbox now but theres a problem there too:
When i was using checkboxes i was doing it like this

Expand|Select|Wrap|Line Numbers
  1.         If checbox1.Checked = True Then
  2.             isChecked.Add(PathToCacheFolder)
  3.         End If
  4.  
  5.         If checbox2.Checked = True Then
  6.             isChecked.Add(PathToDownloadFolder)
  7.         End If
  8.  
when i switched to using checkedlist box it was like this:

Expand|Select|Wrap|Line Numbers
  1.         For ffCheckedFound As Integer = 0 To ffCheckList.Items.Count - 1
  2.             If ffCheckList.Items.Item(ffCheckedFound) Is "Allow Cache" And ffCheckList.GetItemChecked(ffCheckedFound) = True Then
  3.                 ffCheckedOpt.Add(PathToCacheFolder)
  4.             End If
  5.  
  6.             If ffCheckList.Items.Item(ffCheckedFound) Is "Allow Download" And ffCheckList.GetItemChecked(ffCheckedFound) = True Then
  7.                 ffCheckedOpt.Add(PathToDownloadFolder)
  8.             End If
  9.         Next ffCheckedFound
  10.  
The CheckedList code i post above - doesn't it look more complicated then the normal checkbox - or i am doing this wrong? is there a simpler way

I want to see if a checkbox is checked in the CheckedListBox object
like in my current example when some one checks the "Allow Cache" Checkbox in the checkedlistbox it will add value to ffCheckedOpt.

is there a better a way to verify if the user clicked on a certain checkbox
like above- when the user clicks the "Allow Cache" checkbox it adds "PathToCacheFolder" in the varible (is there a better and easier way to do this)

My code is becoming very long - especially since i have so many checkboxes

Sorry if this is very complicated but this is making so tensed myself :(

Thanks in advance
Regards
Oct 5 '08 #1
2 2796
zubair1
79
Hello,

any help plz? ::(
Oct 6 '08 #2
joedeene
583 512MB
Would a for each statement work for like for each checkbox in me.controls? or something like that?

joedeene
Oct 6 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: bienwell | last post by:
Hi, I'm using the CheckBoxList control in ASP.NET for Web development. This checkboxlist is bound by the database. If we have more items for this checkbox list, it takes space on the page. I...
1
by: Carlo | last post by:
Hi I am trying to add a checkbox programmatically next to a list box but with each new item added to the list box it should have a corresponding checkbox. I therefore tried to use a variable for...
0
by: Terry Olsen | last post by:
Dim dirs() as string = Directory.GetDirectories(MyPath) CheckedListBox.DataSource = dirs CheckedListBox.Update For I as Integer = 0 To CheckedListBox.Items.Count - 1...
0
by: toufik | last post by:
Hi, Is it possible ti bind the checkbox of a checkedlistbox... here is my case: I've an employees list and the information about the driving licence class tha the employee has I've 3 tables : -...
2
by: akunuri.swapna | last post by:
Hi All - I have a checkedListBox in my form. I am adding items to it at run time. However I also need to check the items depending on a condition. I have tried a lot but cant get the added item to...
0
by: HKSHK | last post by:
Hi all! With a custom listbox that inherits from CheckedListBox my goal is to show pictures. The problem is that the pictures are at the same position as the checkbox. How can I find out the...
8
by: ameen.abdullah | last post by:
Hi Guys, I have a checked list box on my form.. the purpose of this checkbox is to indicate that the option is enabled or disabled.. I just want to ask if there is a way to disable these check...
6
by: Steve Teeples | last post by:
Can someone show me an example of how to place a "CheckedListBox" property within a PropertyGrid? -- ----------- Thanks, Steve
2
by: bcgreen | last post by:
I have an enum for the days of the week: DaysOfTheWeek.Sunday, DaysOfTheWeek.Monday, etc. that is flaggable so that mutliple days of the week can be indicated. I also have a checkbox list...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.