Click here to Skip to main content
16,019,514 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would like to create a C# app that allows me to move tiles from one location to another.
Picture a window with 20 buttons across the bottom, when a user clicks a button it will pop up a grid container 20x4. Ideally, we should be able to open up to 4 containers depending on desktop real estate. In each grid location, there will be unique buttons(tiles), there may be multiple tiles in each grid location, that can be dragged and dropped from one grid & container location to another. The location of each unique tile will then be saved in a database. I am kind of picturing something sort of like the bag system in World of Warcraft but this will be all text-based, that is, buttons or text boxes, not pixel art or anything like that.

What I have tried:

I have looked around but have not found anything similar enough to what I am hoping to accomplish
Posted
Updated 22-Jul-21 7:29am
v2

Have a read of this article : How to Write Code to Solve a Problem, A Beginner's Guide[^]
Quote:
Picture a window with 20 buttons across the bottom, when a user clicks a button it will pop up a grid container 20x4.
Start there. Right there!

Write a WinForm or WPF program that does exactly that.

Then pause and look at the code you have written. Have you repeated yourself? Does it need to be refactored or generalised? Does it work?

How are you going to determine that there is enough real estate to display x grids. What if there isn't enough space?
- Do you limit the number of grids
- Do you make the grids scrollable and layered?
- Do you make the entire window scrollable?
How do you limit the number of grids to x?
How are you going to "know" the "location" of each unique tile if these grids (and containers?) are created dynamically? Grid 1 is produced by Button 1 etc?

Start simple, with 1 tile per grid. Work out how to drag and drop them from one grid to another, then work your way up to the maximum number of tiles - how do you stop something being dropped onto an already "full" grid


Start answering all these questions (and the rest that will come out as you design this) and then just start coding.
Come back if you get stuck on a particular issue but we can't help if you don't do any work at all.
Quote:
I have looked around but have not found anything similar enough to what I am hoping to accomplish
Being a coder is a little bit more that just finding something on the internet to copy. If you want to build this then design it, then code it. It's not that hard but you have to try.
Quote:
but this will be all text-based.
I have no idea how you think this could possibly be text based.
 
Share this answer
 
Comments
kradoow 22-Jul-21 13:35pm    
I have been coding for 30 years I just never coded anything that I drag and drop buttons. I was looking for something that was similar so I could try to figure it out.
Maciej Los 22-Jul-21 15:33pm    
Unfair downvote has been corrected.
CHill60 23-Jul-21 5:14am    
Thank you Maciej
Quote:
but this will be all text-based

But that will be more trouble that it is worth. You should use Windows Forms or WPF for such an application, as the framework will do all the hard work for you.
 
Share this answer
 
Comments
kradoow 22-Jul-21 13:33pm    
I mean it is not a game, no pixel art, just buttons or text boxes
Richard MacCutchan 22-Jul-21 15:20pm    
Exactly why I gave the answer that I did. But we do not know what experience you have so it is difficult to say more.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900