How to Move an Image using Drag and Drop in Windows Form and C#

  Рет қаралды 7,779

Moo ICT

Moo ICT

Күн бұрын

Пікірлер: 18
@LarghettoCantabile
@LarghettoCantabile Жыл бұрын
This is a great help. It is so much more rational than the Microsoft documentation on dragging and dropping in winforms!
@mooict
@mooict Жыл бұрын
Glad it was helpful!
@delidag
@delidag 2 ай бұрын
Thanks for useful tutorial. I was developped restaurant management software. Now I can place the tables according to the design of the restaurant.
@mooict
@mooict Ай бұрын
Excellent!
@LarghettoCantabile
@LarghettoCantabile Жыл бұрын
When you centre the pointer in the last step, you may want to comment out the update of rect.Location in FormMouseUp. All it really does is affect the coordinates in the text that displays, because the rectangle gets displayed at a different location (the one that is set in the timer event).
@taiweezie
@taiweezie 9 ай бұрын
Thank you for the video. How can I use the original image I downloaded without setting height or width?
@andreiardelean9440
@andreiardelean9440 Жыл бұрын
What theme are you using in Visual Studio?
@EfeErsoy-j3s
@EfeErsoy-j3s 4 ай бұрын
If you do not use a timer, you can get a smoother image. Still a nice video, good luck
@Rand0mp
@Rand0mp Жыл бұрын
if i wanted to add multiple images onto the same form, will i have to repeat this over and over?
@mooict
@mooict Жыл бұрын
I’ve done one for moving multiple images on the channel you’ll find it on the videos list 👍🏽
@iamspy8847
@iamspy8847 9 ай бұрын
how to prevent the image going outside the form while dragging?
@mooict
@mooict 9 ай бұрын
You can change the mouse move event to this - *if (dragging) { if (position.X < 0) { dragging = false; position.X = 3; } else if (position.X + width > this.ClientSize.Width) { position.X = this.ClientSize.Width - (width + 3); dragging = false; } else if (position.Y < 0) { dragging=false; position.Y = 3; } else if (position.Y + height > this.ClientSize.Height) { position.Y = this.ClientSize.Height - (height + 3); dragging = false; } else { position.X = e.X - (width / 2); position.Y = e.Y - (height / 2); }*
@ozkanozdemir6255
@ozkanozdemir6255 Жыл бұрын
Thank you...🙏
@JoeMeyer8998
@JoeMeyer8998 Жыл бұрын
Instead of copying the images into the bin folder you could also set the image property "Copy to output directory" to "Copy if newer", couldn't you?
@mooict
@mooict Жыл бұрын
Yes you could also do that.
@andrecardoso8440
@andrecardoso8440 Жыл бұрын
My image keeps blinking, how can i fix it?
@mooict
@mooict Жыл бұрын
Enable double buffer on the form
@frozenmaw
@frozenmaw 15 күн бұрын
@@mooict Thank you I was having this same issue!
C# OOP Project Drag And Drop Multiple Images in Windows Forms
30:54
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
C# CustomList Using UserControl And FlowLayoutPanel
21:37
Chieng
Рет қаралды 121 М.
Drawing with C# Tutorial #085 - Peroendicular to an Arc
2:47
Mojtaba Javadi
Рет қаралды 147
C# - Using Custom Round Buttons in WinForm App
10:18
Code with HuSyN
Рет қаралды 87 М.
Drag and Drop Operation in windows form c#
8:08
winforms
Рет қаралды 22 М.
C# multithreading 🧶
6:59
Bro Code
Рет қаралды 166 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН