Drag the wpf window with your thumb: can it be transparent?

I tested Blu and I noticed that I can drag the window. This window is transparent. I tried to do the same with Thumb, but I don't know how to make it transparent. The rest of the window is transparent, but the thumb is not.

Is there a way to make my thumb transparent or use a different technique?

I am using this event:

 private void DragThumb_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
    {
        Canvas.SetLeft(this, Canvas.GetLeft(this) + e.HorizontalChange);
        Canvas.SetTop(this, Canvas.GetTop(this) + e.VerticalChange);
    }

thanks

+3
source share
2 answers

You can turn the thumb pointer invisibly using the Opacity attribute.

Opacity = "1" (full visibility)

or

Opacity = "0" (not visible)

Example from my application

        <Thumb Name="myThumb"
               Width="10"
               Height="10"
               DragDelta="onDragDelta"
               DragStarted="onDragStarted"
               DragCompleted="onDragCompleted"
               Margin="5"
               HorizontalAlignment="Right"
               Opacity="1">

        </Thumb>
+8

, , wpf, ( ):

this.DragMove();

.


: : , . MouseDown :

    private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
    this.DragMove();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
    MessageBox.Show("hey");
}

, , ...

+5

Source: https://habr.com/ru/post/1704434/


All Articles