Freelance Project Requests Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net




How do you set a WPF Window so that it is placed directly at the position or place of the mouse when opening?



To do this directly in the event Window _ Loaded adjust the top and left position


    this.Top = Mouse.GetPosition(null).Y;

    this.Left = Mouse.GetPosition(null).X;






In the window, which is opened, you have to use the. Top and. Left property to put the value of the mouse position


private void Window_Loaded(object sender, RoutedEventArgs e)


    //----< Window_Loaded () >--------


    //< Window_Position >

    //*TopLeft-Corner to Mouse-Position

    this.Top = Mouse.GetPosition(null).Y;

    this.Left = Mouse.GetPosition(null).X;

    //</ Window_Position >

    //----</ Window_Loaded () >--------





Activate Event in xaml of Windows Following


WindowStartupLocation="Manual"  Loaded="Window_Loaded" 



Xaml of the window


<Window x:Class="Schichtplaner.PU_Schichtplan_Mitarbeiter"






        mc:Ignorable="d" FontSize="12pt"

        Title="Mitarbeiter wählen" Height="450" Width="400" WindowStartupLocation="Manual"  Loaded="Window_Loaded" 




WPF: Explorer with path open
WPF: Open a Window at a position
WPF: Selection enter open and well take over with Button Elements
WPF: Select Folder with Startup Directory
WPF: FolderDialog and GetFiles
Error CS0234: The type or namespace name Forms does not exist in the namespace
WPF: Filedialog, OpenFileDialog


Contact for Jobs, Project Requests: