locked
Change Window Shape RRS feed

  • Question

  • Hi Everyone,

     

    I am trying to create a program in Blend 4, and I have created a custom shape. I want the window to be the size and shape of the shape.

     

    Thanks in advance,

     

    Hersh


    Hersh K. Bhargava
    Tuesday, November 16, 2010 12:04 PM

Answers

  • Assuming you have followed the instructions at least through the part where you check allows transparency to get rid of the standard window chrome, the next steps are:

    1. Set the window background to clear, select the window, in the properties panel find background, select no brush

    2. Draw what you want, Draw a rectangle and circle, select them both, right click, combine -> unite, now you have some sort of shape, set the fill/border any way you like

    3. Press F5 or run from the menu.

    • Proposed as answer by Chuck HaysModerator Tuesday, November 16, 2010 5:34 PM
    • Marked as answer by hbhargava Wednesday, November 17, 2010 1:55 AM
    Tuesday, November 16, 2010 5:29 PM
    Moderator

All replies

  • http://www.kirupa.com/blend_wpf/custom_wpf_windows.htm

    That article describes most of what you need to do. Have a look and let us know if you need further assistance.

    Tuesday, November 16, 2010 2:29 PM
    Moderator
  • That is helpful, but I still need to be able to make the window have a custom shape. It is irregular.
    Hersh K. Bhargava
    Tuesday, November 16, 2010 3:25 PM
  • Would you care to share what shape you desire?
    Tuesday, November 16, 2010 3:39 PM
    Moderator
  • I am unable to attach the image, but it is a circle with a rectangle through it. It looks a bit like a watch with a strap.

     

     


    Hersh K. Bhargava
    Tuesday, November 16, 2010 5:02 PM
  • Assuming you have followed the instructions at least through the part where you check allows transparency to get rid of the standard window chrome, the next steps are:

    1. Set the window background to clear, select the window, in the properties panel find background, select no brush

    2. Draw what you want, Draw a rectangle and circle, select them both, right click, combine -> unite, now you have some sort of shape, set the fill/border any way you like

    3. Press F5 or run from the menu.

    • Proposed as answer by Chuck HaysModerator Tuesday, November 16, 2010 5:34 PM
    • Marked as answer by hbhargava Wednesday, November 17, 2010 1:55 AM
    Tuesday, November 16, 2010 5:29 PM
    Moderator
  • Thanks!
    Hersh K. Bhargava
    Wednesday, November 17, 2010 1:55 AM
  • I'm not sure what happened to your other question about dragging it, but here is the answer:

    Select whatever object you want to be the place you drag (such as the path object you created with the unite operation), in the properties panel, select the events area (the lightning bolt), find MouseLeftButtonDown and type on a name, such as DragWindow, press enter. Now you are editing the handler for that event. All you need to do is type "Me.DragMove()" and it should work. The handler will look like this:

    Private Sub WindowDragMove(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs)
        Me.DragMove()
      End Sub
    

    Wednesday, November 17, 2010 2:31 PM
    Moderator