Results 1 to 5 of 5

Thread: How to drag a popup window

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    56

    How to drag a popup window

    can anyone advise me how to drag a popup window in wpf

  2. #2
    Lively Member
    Join Date
    Jul 2007
    Posts
    127

    Re: How to drag a popup window

    put this in the xaml for the container of the window. probably a grid.

    Code:
    MouseLeftButtonDown="DragWindow"
    add this to the code and you should be set. you will prob have to tweak this for c# if thats what you r using

    Code:
        Private Sub DragWindow(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
            DragMove()
        End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    56

    Re: How to drag a popup window

    Thanks for your help

    But actually i want to enable drag option for a popup control like the below

    <Popup x:Uid="SVpopup"
    x:Name="SVpopup"
    PopupAnimation="Slide"
    Width="550" Height="400" Placement="AbsolutePoint"
    IsOpen="False" PlacementTarget="{Binding ElementName=MyGraphicsLyrSV}">
    <Border x:Uid="Border2" Margin="10,20,0,20" x:Name="Border2"
    CornerRadius="10,10,10,10"
    ScrollViewer.VerticalScrollBarVisibility="Disabled"
    ScrollViewer.HorizontalScrollBarVisibility="Disabled"
    BorderThickness="5,5,5,5" Background="#FF000000">
    <WebBrowser x:Name="SVBrowser" Visibility="Visible"/>
    </Border>
    </Popup>

    please advise me how to make this popup draggable

  4. #4
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: How to drag a popup window

    Try to handle the PreviewMouseLeftButtonDown event for the Popup class and manipulate any property that sets it's position with the mouse coordinates. It shall be easy to do.
    C# and WPF developer
    My Website:
    http://singlebits.com/

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    56

    Re: How to drag a popup window

    cud u pls help me to do that if you dont mind. thanks in advance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width