 |
| C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 4th, 2004, 02:54 AM
|
|
Authorized User
|
|
Join Date: May 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
About drag event
Hello!
I want to add dragdrop function to a listview,but I don't know how to do it.
How to get information of the files that I want to drag into the listview,for example,path,size,type and so on? I need the information of the files to insert into my database,so I can see them in the listview whenever I want to.
I read the help text of visual studio.net,but the example about dragevent in help text is only to show how to drag the text of a button ,not to drag files.
:)Please tell me when you are free,thank you!
niuwei
__________________
niuwei
|
|

May 4th, 2004, 03:49 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
A .02 second search in Google could have brought you here:
http://www.developer.com/net/vb/arti...0926_1576561_4
This will explain how to add drag and drop functionality to your apps.
Once you have the full file names of the dropped files, you can use static methods from the File class to retrieve more information about them.
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: That Cough Came With a Prize by Bloodhound Gang (Track 11 from the album: Hooray for Boobies) What's This?
|
|

May 5th, 2004, 08:06 AM
|
|
Authorized User
|
|
Join Date: May 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,Imar.
Thank you very much!
This is my first question,so you are my first teacher here.I'm a Chinese boy.Have you ever been to China?China is beautiful country,I wish you can visit Beijing if you have time.Beijing,2008!Please never miss!
:)Best wishes for you!
niuwei
|
|

May 5th, 2004, 09:18 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You're welcome. Glad I could help.
And yes, I have been to China, although they didn't call it that back then ;)
My brother lives there....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Overdue by Muse (Track 11 from the album: Showbiz) What's This?
|
|

May 12th, 2004, 10:55 PM
|
|
Authorized User
|
|
Join Date: May 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry,I appologize for my delay to reply to you.I was ill and had to keep on the bed for a week.Luckly,I'm OK now.
I'm "developing" a software of Video On Demand.
I find asynchronous programming of socket is difficult for me.Although I have succeed in sending and receiving data of text, I don't understand it well.I also have some trobule on the programming about multithreading.
You showed me what a beautiful internet last time and I had got a lot help from it.
This is one of my question.
I send a string to the client,then it was received.But when I add the sentence below to the end of ReceiveCallback() it tell me:" this operating is doing by a wrong thread and you should call the function of treeView1.Invoke() or treeView1.BeginInvoke();
treeView1.Nodes.add(aa);//convert the received bytes to string aa
If you are busy please not reply,maybe I can learn by myself.
If you are free,please give me some words.
Best wishes!
Luk!
niuwei
|
|

May 13th, 2004, 02:47 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi niuwei,
Hope you're feeling better now.
Anyway, I am not sure I understand the problem. Are you trying to code against a TreeView control?
Maybe you can start a new thread in this forum (as the TreeView is not related to the initial "Drag Event" topic, I think) so other people can take a look at it as well.
If you do start a new thread, please post some of the relevant code. Makes it much easier to see what's causing the problem.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

May 13th, 2004, 03:42 AM
|
|
Authorized User
|
|
Join Date: May 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,Imar.
Yes,I'm OK now.Thank you very much.
My problem is that I can't add a TreeNode to a ListView not from the thread in which the TreeView was created.
Now I know why and have solved the problem.
I find these words below from Worker Threads in C# By Alex Farber.
http://www.codeproject.com/csharp/workerthread.asp
".NET allows you to call System.Windows.Forms.Control functions only from the thread in which the control was created. To run them from another thread we need to use the Control.Invoke (synchronous call) or Control.BeginInvoke (asynchronous call) functions. For tasks like showing database records we need Invoke."
Everytime you answer me and reply so quickly that I even can't express how grateful I am.
Do you use "luk" today?
Best wishes!
Cheers,
niuwei
|
|

May 13th, 2004, 04:44 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Do I use "luk" today?????
Not sure if I understand you....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

May 13th, 2004, 10:39 PM
|
|
Authorized User
|
|
Join Date: May 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Please excuse my poor English.
Casually I know "luk" which means luck was a word of Dutch long long ago.So I ask that if you still use the word "luk" nowadays.Clear?
Sorry,my Engligh is much too poor,but I'm studying it everyday.
"it takes practice to become good at something, so I guess I'll just have to keep trying."
I agree with you.
Another thing is that casually I visited your homepage and found its a good way to know you well.I think maybe some people need it,so I have started a new topic to give them some help.But I'm not sure doing that is polite.If not,tell me,please,I'll delete that topic and apologize for my rude.
Sincerely,
niuwei
|
|

May 14th, 2004, 01:52 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Aah, right, now I see. Yeah we have a word "geluk" which means happiness or luck..... ;)
I saw your post about my Web site. I think normally, it would have been considered as spam, but apparently, no moderator has removed it yet.... Not sure if people in the C# forum actually benefit from going to my site directly, as there isn't that much true C# stuff to be found. Usually, I just link to articles or FAQs directly. But I appreciate the thought.
Cheers,
Imar
p.S. Other than the "luk" part, your English seems fine to me...
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Drag and Drop |
batott |
ASP.NET 2.0 Professional |
3 |
April 26th, 2008 07:59 PM |
| Event - Sender & Event args |
dash dev |
C# 2005 |
9 |
December 9th, 2007 07:24 AM |
| C# Mouse Drag? |
arayner |
C# |
0 |
October 19th, 2006 05:45 PM |
| Drag/Drop |
bmains |
Javascript |
1 |
September 22nd, 2004 07:29 PM |
| Drag and drop |
Clive Astley |
Access |
2 |
August 15th, 2003 12:11 PM |
|
 |