473,480 Members | 2,123 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Double Click on Listbox

Is there a way to do go to an even using double click?

I know there is such an event, but I haven't seen any on the asp.net
objects.

I tried to add one, but it didn't go anywhere.

Thanks,

Tom
Nov 19 '05 #1
2 4114
I believe that you will need to use JavaScript to do this.

'CodeBehind
Me.ListBox1.Attributes.Add("onDblClick", "lstDblClicked")

'JavaScript function
<script language='javascript'>
function lstDblClicked(){
for (var i = 0; i < document.forms[0].ListBox1.options.length; i++ {
if (document.forms[0].ListBox1.options[i].selected) {
...
}
}
}
</script>

HTH,
Jody

"tshad" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Is there a way to do go to an even using double click?

I know there is such an event, but I haven't seen any on the asp.net
objects.

I tried to add one, but it didn't go anywhere.

Thanks,

Tom

Nov 19 '05 #2
"Jody Gelowitz" <jg**************@blah.leevalley.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
I believe that you will need to use JavaScript to do this.

'CodeBehind
Me.ListBox1.Attributes.Add("onDblClick", "lstDblClicked")

'JavaScript function
<script language='javascript'>
function lstDblClicked(){
for (var i = 0; i < document.forms[0].ListBox1.options.length; i++
{
if (document.forms[0].ListBox1.options[i].selected) {
...
}
}
}
</script>
That was what I was looking for, but I needed to go farther. I needed to
get back to my asp code and found a way to do that using Javascript as you
suggested.

What I did was:

sub Page_load(s as object,e as eventargs)
if not IsPostBack then
Me.StoredResumes.Attributes("ondblClick") =
"__doPostBack('LbxSender','')"
end if
If Request.Form("__EVENTTARGET") = "LbxSender" Then
Dim strSelected As String
strSelected = StoredResumes.SelectedItem.Value.ToString
Call SelectResume(strSelected)
End If
end sub

Works pretty well, so far.

Thanks,

Tom
HTH,
Jody

"tshad" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Is there a way to do go to an even using double click?

I know there is such an event, but I haven't seen any on the asp.net
objects.

I tried to add one, but it didn't go anywhere.

Thanks,

Tom


Nov 19 '05 #3

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

Similar topics

1
1748
by: Blacky | last post by:
Hi I have a small form with a listbox. When double clicking on an item, the item is added to another form and then the form is closed. But this creates an exception error saying that the ListBox...
0
1452
by: SirThanxALot | last post by:
Dear all, This is the situation: I have a custom subclass of ListBox - OnDrawItem overriden - OnSelectedIndexChanged overriden - DrawMode.OwnerDrawFixed (same issue with OwnerDrawVariable)...
0
1387
by: Daniel Bass | last post by:
I've got a button (server side) next to a list box (server side)... is it possible, that on a double click on the listbox, and event can cause a button click simulation? I've manually inserted...
5
3040
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
2
1399
by: active | last post by:
I've been working on a problem for a few days now. I do not get a Double-Click event fired for a ListView when I double click. I now find that if I double click with the right button it works OK....
1
1766
by: active | last post by:
I've been working on a problem for a few days now. I do not get a Double-Click event fired for a ListView when I double click. I now find that if I double click with the right button it works OK....
1
2272
by: Rahul Vaghela | last post by:
I have two list boxes, 1 with a list of products and another that is empty.. I would like to double click on the products in the first list box and fill the empty listbox with the items that get...
4
4731
by: Jeff User | last post by:
Hi Using .NET 1.1, C#, web app I (actually our client) would like to be able to double click a selection in a listbox and have it postback to server . There I would want to access the item that...
6
9570
patjones
by: patjones | last post by:
Sometimes you might have two list boxes side by side, and want to double-click on an item in one box to move it to the other. For instance, maybe the first list box contains a list of customers,...
2
7686
by: svibuk | last post by:
i have a asp.net list box populated with databae data , autopostback = true wht i need is 1) when double clicked(double click event) i want it to be visible=false 2)i want to move between the...
0
7050
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7091
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
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2999
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...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
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 ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.