473,320 Members | 1,713 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,320 software developers and data experts.

CheckListBox MouseOver

Hi ALL,

Can any one give me a solution to handle mouse over event of each of the
Check Box Control in a CheckListBox Control.

Thanks in advance

Regards
Vidds
Jan 12 '06 #1
1 1303
The items that you would need to modify in the CheckBoxList are private,
so they can't be manipulated. If this is a absolute must-have, you can
resort to modifying the rendered output of the control to do what you
want.

Add this class:
Public Class ChkboxListWithMouseOver
Inherits CheckBoxList

Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
Dim html As String
Dim sw As New IO.StringWriter
Dim capture As New HtmlTextWriter(sw)

MyBase.Render(capture)

html = sw.GetStringBuilder.ToString
html = html.Replace("type=""checkbox""", _
"type=""checkbox"" onmouseover=""alert('you moused
over.');""")

writer.WriteLine(html)

End Sub
End Class

Create a page with the control:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="TestPage.aspx.vb" Inherits="**YOURPROJECT**.TestPage"%>
<%@register tagprefix="cb" assembly="**YOURPROJECT**"
namespace="**YOURPROJECT**" %> <html>
<body>
<form id="Form1" method="post" runat="server">
<cb:ChkboxListWithMouseOver Runat=server ID="chkList" />
</form>
</body>
</html>

(**YOURPROJECT** is the name of your project. You must replace this
value. If you are using namespaces, edit accordingly.)

Hope this helps.

--
----
700cb Development, Inc.
http://www.700cb.net
..NET utilities, developer tools,
and enterprise solutions
"=?Utf-8?B?VmlkZHM=?=" <Vi***@discussions.microsoft.com> wrote in
news:83**********************************@microsof t.com:
Hi ALL,

Can any one give me a solution to handle mouse over event of each of
the Check Box Control in a CheckListBox Control.

Thanks in advance

Regards
Vidds


Mar 13 '06 #2

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

Similar topics

1
by: ncookson | last post by:
I am trying to add a caption or title to the box drawn around a checklistbox and having no luck. Is there a way to do this? I am using python 2.3.4 and wxPython 2.5 on a windows platform. Noel
5
by: Bernie Yaeger | last post by:
Is there any way to get a listbox or a checklistbox behave in an autocomplete manner, such that given 'two', 'three', 'water', 'them' would bring the selection to 'two' (not 'water') when I key in...
3
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data,...
1
by: comic_rage | last post by:
Hi, I created a checkListBox to allow the user to select and place a check next to multiple items in the GUI. I would like to add a 2 column where the first column show the description of the...
2
by: Mike Kim | last post by:
hi all, i have a checklistbox populated with about 50 items from database. and on the same form, i added to button to do the following. if you click this button, i want to have all items in the...
0
by: Ville Mattila | last post by:
Dear readers, I've some problems with the data binding of the checklistbox control. I'm using it with user preferences that are stored in a XML File. Information from the file is fetched with...
1
by: obrienkev | last post by:
Hi, I want to mark the CheckListBox items as Checked based on a database query. So the CheckListBox items should be checked if each item matches fundsAffected field from the below query... ...
3
by: obrienkev | last post by:
Hi all, How do I mark an item in a checklistbox as checked based on a condition? e.g. if(x=1) { // SET a ChecklistBox Item as Checked }
3
by: khalidjan9 | last post by:
I have data in an arraylist and i want to add data to checklist box on runtime and i also want to display a textbox besides it so that i get the comments example : checklistbox "text" textbox...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.