Ravi
New member
- Joined
- Jun 4, 2021
- Messages
- 1
- Programming Experience
- Beginner
Hi all, I'm new to programming and also to this forum.
I'm currently developing a C# WPF application which contains an image. I've written some code to dynamically add a Button onto that image.
Now, I need to achieve the following-
1. Make the button movable with a mouse cursor all over the image, but not outside of it
2. Make the button rotate 90, 180 degrees
I will be greatful if someone helps me with this.
I'm currently developing a C# WPF application which contains an image. I've written some code to dynamically add a Button onto that image.
C#:
public void SomeFunction()
{
var button = new Button();
button.Name = "btn" + randomNumber;
button.Content = "New Button " + randomNumber;
button.FontSize = 14;
Grid.SetColumn(button, 8);
Grid.SetRow(button, 25);
Grid.SetColumnSpan(button, 25);
Grid.SetRowSpan(button, 5);
gridMainWindow.Children.Add(button);
}
Now, I need to achieve the following-
1. Make the button movable with a mouse cursor all over the image, but not outside of it
2. Make the button rotate 90, 180 degrees
I will be greatful if someone helps me with this.