Set Opacity when dragging a form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EinToR
    New Member
    • May 2008
    • 20

    Set Opacity when dragging a form

    I'm trying to set the opacity = .50 when dragging a windows form. Here's what I've got:

    Code:
            public Form1()
            {
                InitializeComponent();
                this.Move += new EventHandler(Dragging);
            }
    
            private void Dragging(object sender, EventArgs e)
            {
                Opacity = .50;
            }
    When I run the application, the Move event is fired from the get-go. What 2 events can be overloaded to set the opacity "OnDragStar t" and "OnDragStop "?

    Thanks,
  • joedeene
    Contributor
    • Jul 2008
    • 579

    #2
    you could possibly use the resizebegin and resizeend form events, heres an event in visual basic.net

    Code:
    Private Sub MainForm_ResizeBegin(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeBegin
    
    Me.Opacity = 0.6
    
    End Sub
    
    Private Sub MainForm_ResizeEnd(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeEnd
    
    Me.Opacity = 1
    
    End Sub

    Comment

    • EinToR
      New Member
      • May 2008
      • 20

      #3
      That worked GREAT!!! Thank's for your help.

      Comment

      Working...