473,748 Members | 2,670 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4755
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*****@hotmai l.comwrote in message
news:ec******** *************** *********@4ax.c om...
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, IPostBackEventH andler
{
public event EventHandler DblClick;
private const string _DOUBLE_CLICK = "dbl";

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

protected override void OnInit(EventArg s e)
{
if (this.Page != null)
{
this.Page.Regis terRequiresCont rolState(this);
}
base.OnInit(e);
}

protected void Page_PreRender( object sender, EventArgs e)
{
string script = this.Page.GetPo stBackEventRefe rence(this, _DOUBLE_CLICK);
this.Attributes .Add("ondblclic k", script);
}

void IPostBackEventH andler.RaisePos tBackEvent(stri ng eventArgument)
{
if (eventArgument == _DOUBLE_CLICK)
{
this.OnDblClick (EventArgs.Empt y);
}
}
}

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*****@hotmai l.comwrote in message
news:ec******** *************** *********@4ax.c om...
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************ *****@discussio ns.microsoft.co mwrote:
>You will need to define this event by yourself - override the DropDownList:

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

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

protected override void OnInit(EventArg s e)
{
if (this.Page != null)
{
this.Page.Regis terRequiresCont rolState(this);
}
base.OnInit(e);
}

protected void Page_PreRender( object sender, EventArgs e)
{
string script = this.Page.GetPo stBackEventRefe rence(this, _DOUBLE_CLICK);
this.Attributes .Add("ondblclic k", script);
}

void IPostBackEventH andler.RaisePos tBackEvent(stri ng eventArgument)
{
if (eventArgument == _DOUBLE_CLICK)
{
this.OnDblClick (EventArgs.Empt y);
}
}
}

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*****@hotmai l.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************ *****@discussio ns.microsoft.co mwrote:
You will need to define this event by yourself - override the DropDownList:

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

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

protected override void OnInit(EventArg s e)
{
if (this.Page != null)
{
this.Page.Regis terRequiresCont rolState(this);
}
base.OnInit(e);
}

protected void Page_PreRender( object sender, EventArgs e)
{
string script = this.Page.GetPo stBackEventRefe rence(this, _DOUBLE_CLICK);
this.Attributes .Add("ondblclic k", script);
}

void IPostBackEventH andler.RaisePos tBackEvent(stri ng eventArgument)
{
if (eventArgument == _DOUBLE_CLICK)
{
this.OnDblClick (EventArgs.Empt y);
}
}
}

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*****@hotmai l.comwrote in message
news:ec******** *************** *********@4ax.c om...
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
1431
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
2691
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, frmNewMatter, for adding new records to the db. The form is based on tblFile and has a subform based on tblContact,
1
1820
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. It just occurred to me that I do have a MouseMove event that starts a Drag for the left button if the mouse moves. But I'm not moving the mouse. Should that have any effect?
2
3507
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 like a singe click event(that is mouseup here)so that that will fire mouseup.How can i implement this?any ideas ? code snippets? Thanks in advance satish
3
3589
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 mouseup is called twice for the mouse double click over the selected tree node. I want mouseup event to be called onece Any ideas?
2
9508
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 click event. if they click once, it should trigger single click event. if they click twice, it should trigger double click event. please Help. Cumars
6
3201
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, display_01_02 ... display_12_31. This is used to display bookings of holiday properties and works well. I am now wishing to be able to highlight a range of dates by double clicking in one text box and then in another, highlighting all the dates...
2
7715
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 data in the listbox using up, down arrow keys & make the selection by pressing eneter(keypress event) 3) everytime i move betwen the data(autopostback = true) postback is caused,is it possible to avoid the flickering without ajax as if i have to...
15
11856
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 search field. Sub form B has a query as recordset. The query use the search field value as a filter, and the filter is updated every time text is entered into the search field. What I want to happen is to set focus on the search field once form b...
0
9561
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9381
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...
0
8252
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3316
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
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
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.