Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CheckListBox MouseOver

Reply
Thread Tools

CheckListBox MouseOver

 
 
=?Utf-8?B?VmlkZHM=?=
Guest
Posts: n/a
 
      01-12-2006
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
 
Reply With Quote
 
 
 
 
cbDevelopment
Guest
Posts: n/a
 
      03-13-2006
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=?=" <> wrote in
news:83F4BD94-9CFB-4E1D-89D2-:

> 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
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Height of checklistbox Vikram ASP .Net 1 03-01-2005 06:40 AM
wxPython and CheckListBox ncookson@networkusa.net Python 1 01-13-2005 01:05 PM
Problem with CheckListBox Mau ASP .Net 3 09-27-2004 03:38 PM
CheckListBox brian ASP .Net 0 04-27-2004 04:13 PM
Looking in a cookie collection to preselect checklistbox items D. Shane Fowlkes ASP .Net 0 04-07-2004 03:14 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57