|
Hello,
Interesting question!
I have a very dirty workaround for you. Some, might say I only provide dirty solutions
.)
Easy solution would be to use the MouseDown event and chack the Clicks property of the MouseEventArgs.
I know that "Clicks>1" is not equal doubleclick, but maybe it fits for you.
Here you can do a check if the Y position of the MouseEventArgs is inside a region.
This region can be validated with the "PreferredHeight" property of the ArrayList class.
Dirty is, that it needs an offset depending on the "BoarderStyle" you are using.
Here an example:
private void yourListBoxes_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Clicks>1)
{
ListBox ActListBox = sender as ListBox;
int YactHeight;
if(ActListBox.BorderStyle == BorderStyle.None)
{
YactHeight= ActListBox.PreferredHeight;
}
else
{
YactHeight= ActListBox.PreferredHeight - 8;
}
if(e.Y<=YactHeight)
{
}
}
}
If you need it more often I would suggest you to inherit your ownb ListBox.
This should override the OnMouseDown method and do the validation there.
If the position is inside the Items region you could fire an custom event there, which you handle in your code.
.)
The other solution could be, to handle the DoubleClick.
As the System.EventArgs do not provide a act position, you would have to use the Cursor position in combination with the controls position PointToScreen.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Thanks a lot Martin.
I was approaching to ur suggestion only. Meanwhile i got other suggestion also. I would like to share it with you.
Add this to your double-clicked event handler:
Point p = Cursor.Position;
p = listBox1.PointToClient(p);
if (listBox1.IndexFromPoint(p) != -1)
{
//An item was double-clicked!
}
it also works fine for me.
|
|
|
|
|
Hello,
Interesting!
I was close with my second suggestion, but never heard of "IndexFromPoint" before.
Thanks for the feedback!
Got my '5'!
All the best,
Martin
|
|
|
|
|
Actually I am using MSAccess And i am storing only the path of image now in this case what I have to do in order to show the images in the cystal reports
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Hallo,
Anybody there please help me to show me how I can render movie as desktop wallpaper (like Dreamscene in Vista) using managed DirectX and C# ?
Thanks in advance...
Anindya Chatterjee
|
|
|
|
|
Hello friends,
I want to do word file parsing. i want to fetch out particular information from it.
E.g. I want to take email id , phone etc from resume document.
What thing should be used for this. I have searched ineterop library may be helpfull
for this. What other things are there.
Thanks in Advance.
Rahul Kulkarni
|
|
|
|
|
What type of doucment is it you ware wanting to parse? Is the file fixed width, or is it delimited?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
How to call BRE rules in C# applications like windows forms or web form, if possible please provide samples....
Prashant
|
|
|
|
|
parasu_516 wrote: How to call BRE rules
What is BRE?
parasu_516 wrote: C# applications like windows forms or web form
What do you mean??
C# application can be Windows form or webform....
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Michael Sync wrote: What is BRE?
Assumption: Business Rules Engine (AKA Business Layer)
|
|
|
|
|
J4amieC wrote: Business Rules Engine (AKA Business Layer)
Oh.. Thanks...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Does anybody know how to use trackBar to set the motion sensitivity
level ???
Hope somebody can help me..
Thanks in advance.
hussain
|
|
|
|
|
The trackbar can trivially be used to get a changing value. The real question is, what motion sensitivity level ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Is there a way that I can import multiple projects (csproj, vbproj) at one time. As we all know vs2005 has a add project to solution option, but I cannot select multiple projects at once. I have a lot of projects and importing one at a time get tedious very quickly. So if there is any plugin/app/workaround please let me know.
|
|
|
|
|
Is there .NET wrappers for shared memory ?
I'm using .NET 1.1, and I just need to have a counter variable (Integer type) that needs to be accessed from different processes of the same program.
Think it this way, when a program runs, it increments this counter once. So at any time, the counter value is the number of current instances of the same program.
Xavier
|
|
|
|
|
I have one but doesn't work on x64 system (some function I interop with are missing on x64).
Reply by email and I could send it to you
|
|
|
|
|
Hello, my name is Joan Miramontes, and im actually developing an application using the upnp stuff,
this is for a project for my BA D,
... so i have been using the upnp intels tools to get familiarized with them, in order to develop an application with c#,
the objective is to develop a control point, the control point need to have the posibility as well as one of the tools of intels of be aware of all the activity of the devices and be capable of control them, also it will be able of .. show the device, like if it was the device, in the other hand also build the devices... in order that the control point can control them, or should i say use them.
Well the thing here so far is thath i already know more or less how to build the device, im using the intel tools(the device builder and author service ) and just add the c# code that i need on every device. my prob here is that i have no idea on how make the control point, how to make the application that discovers the devices, and be able to control them or use the services that each one has... how to make the functions or the classes... or if its some already build it, where to find them or use them...
i forget to mention that all the applications im developing is for windows so im using projects on the .net application with forms and all the graphic stuff.
I hope that someone will be able to help me...
|
|
|
|
|
This isn't a C# question but this link will help you
http://www.computerhope.com/datehlp.htm[^]
I use batch files A LOT and they can do thing in two or three lines that a 300k C# app can't...
(a mod might move your thread to the right location)
|
|
|
|
|
Sorry I posted in wrong board.
... it's now here...
I've already consulted Computer Hope, didn't find what I needed there. The most difficult part is to compute "Yesterday"
|
|
|
|
|
Hi,
I Have a Problem with this code ; below code is in turbo c++ and don't Know How To Convert it to c#2.0 code ?
#define COM 0x3f8
void Init_Serial(unsigned int Parity)
{
//Init Serial
int c;
outp(COM+3,0x80);//DLAB=1
outp(COM,0x0c); //Baud rate 9600
outp(COM+1,0x00);
outp(COM+3,Parity);
c= inp(COM+5);
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/c8zc5kah.aspx[^]
The above link is an example showing how to use serial ports in C#. It will show you how to setup, open, send data, and so on...
It is even easier than C++ in WindowsNT; though not as easy as Win 9X (read DOS) days with direct hardware access...
|
|
|
|
|
i saw that theres a way to host an internet explorer window inside winform application and also that i can host any application that has an activex like adobe acrobat, microsoft word, excel etc.
how can i (if at all) create a winform that can host any application ? a window that just enables me to run every regular application that i have inside it ?
thanx,
|
|
|
|
|
ActiveX is via interop with COM and for IE I'd suggest the "Web Browser" control (it is just IE)
|
|
|
|
|
for ie hosting on my winform im indeed using webform control, and for other apps that arrive with activex i can add the activex to my winform. my question is, how can i host other applications that doesnt arrive with activex ?
and another question: i used the code on this website to produce a transparent and clickthrough enabled, but i wish to have controls on the page that arent transparent and clickthrough, how can i acheive this ?
thanx,
|
|
|
|
|
From what I know/understand you can only use COM and "managed" (read .NET code) inside a C# project.
(note ActiveX is just a small part of COM)
If the it is possible to host non-COM objects I don't know how, if you' just wish to start another process then http://blogs.msdn.com/csharpfaq/archive/2004/06/01/146375.aspx[^] will help you...
I'm not sure what you mean by "wish to have controls on the page that arent transparent and clickthrough"
Do you want to have a form with a button of a z-index of 1 and overlay say a picture box with a z-index of 2 but when you click on the picture box where the button is location it will process a click on the button?
|
|
|
|