473,732 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CheckedListBox in Windows Form

Hi All,

How do I store a string value for an item in a CheckedListBox in
Windows Form?

For a web based application, CheckBoxList allowed us to store 2 string
values for the item in it. How do I achieve that when making use of the
CheckedListBox in windows form.

Thanks.

Nov 17 '05 #1
1 6011
One suggestion is to follow Nicholas Paldino's advice about listboxes from
November 10th......

Wrap your data in an class and then override the class' ToString() method
(public override string ToString()).

Afterwards, instantiate an instance of the class, populate it with data,
insert the instance of the class into the CheckedListBox' s Items collection,
and repeat as necessary.

The CheckedListBox will use the ToString() of your new class to determine
what to show on each line.
Have fun!

Dave


<xi********@yah oo.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Hi All,

How do I store a string value for an item in a CheckedListBox in
Windows Form?

For a web based application, CheckBoxList allowed us to store 2 string
values for the item in it. How do I achieve that when making use of the
CheckedListBox in windows form.

Thanks.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2042
by: pothik05 | last post by:
I can not make the DrawItem event to work on the CheckedListBox control. I suggestion will be highly appreciated. I have the following code. The code works for ListBox and the second item (Two) is displayed in red in the ListBox but the CheckedLIstBox displays everything in black (where it should be displayed as red). Public Sub New() MyBase.New()
2
2181
by: Erik Cruz | last post by:
Hi. I have read some articles about hosting windows forms controls on asp.net pages but all of them show how to use custom controls. I would like to show on one of my pages the checkedlistbox windows control. I believe that the steps are the same, but what do I need to reference in my <object> tag in order to acomplish this? TIA, Erik Cruz
4
3796
by: Matthew | last post by:
Hi, I am using a checkedlistbox on a windows form and binding it to a collection of classes. clbAliases is the checkedlistbox control selectedplace is a class with property placealiases.This property is a collection of placealias classes. Hopefully the rest is self-explanatory..
3
4703
by: Steve Cutting | last post by:
Hi all, I have a CheckedListBox on one pane of a TabControl on a form. I find that whenever the user clicks a different tab then comes back, any checks that were in the list have disappeared. After a bit of experimenting I have discovered that the problem only occurs when the CheckedListBox is using a dataset table as the source. If I manually add items to it's collection using the properties window, it works fine. If I bind it to a...
1
1524
by: Capt_Ron | last post by:
Hello and thank you for taking the time to look. I Have a form that asks for options. I need the user to click any of the options listed. I'd like to use the CheckedListBox for this but I need to know how it works. I have the options in a table in a database. I would like to have the datasource of the CheckedListBox be a datareader that has 2 columns. One column is the Primary Key and the other is the text of the option.
1
2162
by: Huahe | last post by:
Hi, I have an checkedlistbox with a lot of items, so there is a vertical scrollbar in the checkedlistbox. I want to make the checkedlistbox invisible when the mouseleave event goes off. The mouseleave event goes off when I move the mouse to the scrollbar. Can someone explain this to me? Isn't the scrollbar a part of the checkedlistbox? -- Huahe
3
24879
by: BostonNole | last post by:
Does anyone know how to get the checkedlistbox to display items horizontally on a windows form? It seems that it only displays its check box items vertically (up and down), which is not what I want. I want to be able to use the CheckedListBox to display the days of the week going across (horizontally) a windows form. Thanks.
6
6934
by: Steve Teeples | last post by:
Can someone show me an example of how to place a "CheckedListBox" property within a PropertyGrid? -- ----------- Thanks, Steve
6
4186
by: painkiller | last post by:
language: vb.net environment: windows forms .net : v1.1 i am having a checkedlistbox control that display document category such as text, image, video, audio etc. these values are coming from database. when a user clicks any of the above values and saves the form, the item's "value" is getting saved in database. and when a user logs back in, his/her previously checked value items should be shown as checked. Everything is working fine...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.