473,406 Members | 2,816 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,406 software developers and data experts.

double click event on listbox

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 was double clicked.

Any idea how to go about this?

Thanks
Jeff
Aug 22 '07 #1
4 4725
Lit
Jeff,

I don't see a double click on a listbox. I been looking for this. I need
that functionality or possibly a Ctrl-Click

hope someone will give us an answer.

Lit
"Jeff User" <je*****@hotmail.comwrote in message
news:ec********************************@4ax.com...
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 was double clicked.

Any idea how to go about this?

Thanks
Jeff

Aug 23 '07 #2
You will need to define this event by yourself - override the DropDownList:

public class myDropDownList : DropDownList, IPostBackEventHandler
{
public event EventHandler DblClick;
private const string _DOUBLE_CLICK = "dbl";

protected virtual void OnDblClick(EventArgs e)
{
if (DblClick!= null)
{
DblClick(this, e);
}
}

protected override void OnInit(EventArgs e)
{
if (this.Page != null)
{
this.Page.RegisterRequiresControlState(this);
}
base.OnInit(e);
}

protected void Page_PreRender(object sender, EventArgs e)
{
string script = this.Page.GetPostBackEventReference(this, _DOUBLE_CLICK);
this.Attributes.Add("ondblclick", script);
}

void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
{
if (eventArgument == _DOUBLE_CLICK)
{
this.OnDblClick(EventArgs.Empty);
}
}
}

Please note that I do not have 1.1 handy - and the code above I compiled
from a similar control in 2.0 - so there might be some syntax errors - I just
wanted to get you an idea of how this could be accomplished.

"Lit" wrote:
Jeff,

I don't see a double click on a listbox. I been looking for this. I need
that functionality or possibly a Ctrl-Click

hope someone will give us an answer.

Lit
"Jeff User" <je*****@hotmail.comwrote in message
news:ec********************************@4ax.com...
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 was double clicked.

Any idea how to go about this?

Thanks
Jeff


Aug 23 '07 #3

I want to do this with a listbox, not a dropdownlist.
Is the procedure the same?

Thanks
jeff

On Wed, 22 Aug 2007 22:44:00 -0700, Sergey Poberezovskiy
<Se*****************@discussions.microsoft.comwrot e:
>You will need to define this event by yourself - override the DropDownList:

public class myDropDownList : DropDownList, IPostBackEventHandler
{
public event EventHandler DblClick;
private const string _DOUBLE_CLICK = "dbl";

protected virtual void OnDblClick(EventArgs e)
{
if (DblClick!= null)
{
DblClick(this, e);
}
}

protected override void OnInit(EventArgs e)
{
if (this.Page != null)
{
this.Page.RegisterRequiresControlState(this);
}
base.OnInit(e);
}

protected void Page_PreRender(object sender, EventArgs e)
{
string script = this.Page.GetPostBackEventReference(this, _DOUBLE_CLICK);
this.Attributes.Add("ondblclick", script);
}

void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
{
if (eventArgument == _DOUBLE_CLICK)
{
this.OnDblClick(EventArgs.Empty);
}
}
}

Please note that I do not have 1.1 handy - and the code above I compiled
from a similar control in 2.0 - so there might be some syntax errors - I just
wanted to get you an idea of how this could be accomplished.

"Lit" wrote:
>Jeff,

I don't see a double click on a listbox. I been looking for this. I need
that functionality or possibly a Ctrl-Click

hope someone will give us an answer.

Lit
"Jeff User" <je*****@hotmail.comwrote in message
news:ec********************************@4ax.com.. .
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 was double clicked.

Any idea how to go about this?

Thanks
Jeff


Aug 23 '07 #4
Jeff,

The code that refers to handling double click event is not control specific
- you should be able to use it in ListBox.

"Jeff User" wrote:
>
I want to do this with a listbox, not a dropdownlist.
Is the procedure the same?

Thanks
jeff

On Wed, 22 Aug 2007 22:44:00 -0700, Sergey Poberezovskiy
<Se*****************@discussions.microsoft.comwrot e:
You will need to define this event by yourself - override the DropDownList:

public class myDropDownList : DropDownList, IPostBackEventHandler
{
public event EventHandler DblClick;
private const string _DOUBLE_CLICK = "dbl";

protected virtual void OnDblClick(EventArgs e)
{
if (DblClick!= null)
{
DblClick(this, e);
}
}

protected override void OnInit(EventArgs e)
{
if (this.Page != null)
{
this.Page.RegisterRequiresControlState(this);
}
base.OnInit(e);
}

protected void Page_PreRender(object sender, EventArgs e)
{
string script = this.Page.GetPostBackEventReference(this, _DOUBLE_CLICK);
this.Attributes.Add("ondblclick", script);
}

void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
{
if (eventArgument == _DOUBLE_CLICK)
{
this.OnDblClick(EventArgs.Empty);
}
}
}

Please note that I do not have 1.1 handy - and the code above I compiled
from a similar control in 2.0 - so there might be some syntax errors - I just
wanted to get you an idea of how this could be accomplished.

"Lit" wrote:
Jeff,

I don't see a double click on a listbox. I been looking for this. I need
that functionality or possibly a Ctrl-Click

hope someone will give us an answer.

Lit
"Jeff User" <je*****@hotmail.comwrote in message
news:ec********************************@4ax.com...
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 was double clicked.

Any idea how to go about this?

Thanks
Jeff

Aug 23 '07 #5

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

Similar topics

0
by: CoreyMas | last post by:
Hello everyone Is there a way to create a double click event on a listbox control in VB.net without having to resort to Javascript? Thanks in advance Corey
2
by: Uninvisible | last post by:
I have put together a db for a law firm to keep track of counterfeit activities. There are four parent tables: tblContact tblTransaction tblAction tblFile I have created a form,...
1
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....
2
by: techsatish | last post by:
Hi, I want the double click event to call(here not able to get the MouseEventArgs) and execute the mouseup event code or any one tell me how to make my treecontrol double click nodes to behave...
3
by: Techsatish | last post by:
how to make a mouseup event called only once during a double click event? here double click is made on a tree node in a tree control. I have the code inside mouseup event....in runtime the...
2
by: cumars | last post by:
Hello Friends, I want to trigger both the click event and double click event in a single button separately. (i.e.) the user can trigger both the single click and the double...
6
by: Jim Devenish | last post by:
I have an unbound form that displays all the days of the year as a calendar. It has 12 rows of text boxes with either 29,30 or 31 in each row. Text box names are of the form: display_01_01,...
2
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...
15
by: Martin Lang | last post by:
Hi All, Thanks for reading this :) I have a form A that consists of a main form A and a sub form A. In sub form A, I have a field which I can double click. Then, Main form B opens up with a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
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...
0
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.