Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 C# Drag and Drop Help
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Foxhunter




PostPosted: Mon Jan 10, 2011 11:16 am   Post subject: C# Drag and Drop Help

In C# For the final project we are making Towers of Hanoi for our game (google it if you don't know what that is)

To do this, we need a drag and drop function so we can drag the rings and drop them on the pegs. However we want to do this by having the computer recognise we are clicking on a particular ring, and then dragging it. Is there anyway to do this?

ANY help you can offer would be extremely appreciated, we are somewhat C# Incompetent, so step by step would be very nice.

In addition, how do you play music simultaneously with the code? So we can have Contra music in the background of our game.

Thanks! Smile
Sponsor
Sponsor
Sponsor
sponsor
2goto1




PostPosted: Mon Jan 10, 2011 11:40 am   Post subject: RE:C# Drag and Drop Help

On the drag-and-drop side, if you're using WPF, this may help to get you going. It's very step-by-step, and covers concepts such as dragging visuals as well:

http://blogs.msdn.com/b/jaimer/archive/2007/07/12/drag-drop-in-wpf-explained-end-to-end.aspx.
Foxhunter




PostPosted: Tue Jan 11, 2011 10:01 am   Post subject: RE:C# Drag and Drop Help

The link you gave me is broken
'The resource cannot be found'

Thanks for trying though Smile
The Lone Ranger




PostPosted: Tue Jan 11, 2011 10:05 am   Post subject: Re: C# Drag and Drop Help

By the looks of it, this Foxhunter guy sounds incredibly stupid. I think we should all do him a favour and help him out with this program. It is our duty as COMPUTER PROGRAMERS to help anyone in need. Therefore I shall call all capable programers to assemble to help this wound programming animal complete this program.
2goto1




PostPosted: Tue Jan 11, 2011 10:08 am   Post subject: Re: RE:C# Drag and Drop Help

Foxhunter @ Tue Jan 11, 2011 10:01 am wrote:
The link you gave me is broken
'The resource cannot be found'

Thanks for trying though Smile


http://blogs.msdn.com/b/jaimer/archive/2007/07/12/drag-drop-in-wpf-explained-end-to-end.aspx

There was an extra period at the end of the URL. The one above should work.
Foxhunter




PostPosted: Tue Jan 11, 2011 10:17 am   Post subject: Re: RE:C# Drag and Drop Help

2goto1 @ Tue Jan 11, 2011 10:08 am wrote:
Foxhunter @ Tue Jan 11, 2011 10:01 am wrote:
The link you gave me is broken
'The resource cannot be found'

Thanks for trying though Smile


http://blogs.msdn.com/b/jaimer/archive/2007/07/12/drag-drop-in-wpf-explained-end-to-end.aspx

There was an extra period at the end of the URL. The one above should work.


Thank you! Quick question, what is WPF? And how do i know if i am running it?
2goto1




PostPosted: Tue Jan 11, 2011 10:20 am   Post subject: Re: RE:C# Drag and Drop Help

Foxhunter @ Tue Jan 11, 2011 10:17 am wrote:


Thank you! Quick question, what is WPF? And how do i know if i am running it?


http://msdn.microsoft.com/en-us/library/ms754130.aspx
Foxhunter




PostPosted: Tue Jan 11, 2011 10:21 am   Post subject: Re: C# Drag and Drop Help

Thanks for your assistance!
Sponsor
Sponsor
Sponsor
sponsor
2goto1




PostPosted: Tue Jan 11, 2011 10:23 am   Post subject: RE:C# Drag and Drop Help

It's an alternative to "win forms", it's the newest way to make desktop apps on Windows. It is easier to produce more visually appealing apps with it versus win forms, and for something like towers of hanoi, might be a good fit.

Comparison of the two: http://stackoverflow.com/questions/202079/wpf-versus-winforms
2goto1




PostPosted: Tue Jan 11, 2011 10:31 am   Post subject: RE:C# Drag and Drop Help

Alternatively (since you're doing c#) Microsoft provides a thing similar to Flash called Silverlight. A Silverlight app runs in your browser just like a Flash app. Silverlight UI's are also based on WPF. See [url]http://msdn.microsoft.com/en-us/library/ff921107(v=pandp.20).aspx[/url].

Up to you whether you make a desktop app or a Silverlight app.
princessaegloss




PostPosted: Tue Jun 05, 2012 4:26 am   Post subject: RE:C# Drag and Drop Help

Hi,

I saw a nice example of towers of Hanoi done in windows forms. With drop and drag functionality on the disks.

Have a look:

http://www.codeproject.com/Articles/393158/Towers-of-Hanoi
mirhagk




PostPosted: Tue Jun 05, 2012 7:39 am   Post subject: RE:C# Drag and Drop Help

@Princessaegloss, the original poster probably doesn't go on this site anymore, and if they did, they wouldn't worry about a final project due over a year ago. Thanks for the help but please try to help up to date threads. Thank you.
QuantumPhysics




PostPosted: Tue Jun 05, 2012 1:55 pm   Post subject: RE:C# Drag and Drop Help

In msvs there is a built-in command for the drag and drop option so if you build with the windows form application in msvs you will have access to the public library of all the drag and drop functions
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 13 Posts ]
Jump to:   


Style:  
Search: