DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 22 Aug 2007 19:41:19 -0400,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Jeff User
          2    Lit
          3    Sergey Poberezovskiy
          4    Jeff User


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
Date:Wed, 22 Aug 2007 19:41:19 -0400   Author:  

Re: double click event on listbox   
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"  wrote in message 
news:ecipc392ofh8rnm1hmvl6edc5n8ku3njbg@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 
Date:Wed, 22 Aug 2007 17:22:50 -0700   Author:  

Re: double click event on listbox   
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"  wrote in message 
> news:ecipc392ofh8rnm1hmvl6edc5n8ku3njbg@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 
> 
> 
> 
Date:Wed, 22 Aug 2007 22:44:00 -0700   Author:  

Re: double click event on listbox   
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
 wrote:


>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"  wrote in message 
>> news:ecipc392ofh8rnm1hmvl6edc5n8ku3njbg@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 
>> 
>> 
>> 
Date:Thu, 23 Aug 2007 09:32:05 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us