Results 1 to 7 of 7

Thread: Click & drag opacity change

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Click & drag opacity change

    Hi everyone,

    Is there a way to make my form's opacity change if you click and drag the form to a different location on the screen?

  2. #2
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: Click & drag opacity change

    sure that is possible, but if you can be more specific as to what you are trying to do then perhaps we can be more help.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Re: Click & drag opacity change

    Hi bmahler,

    I am trying to make my form's opacity change to 75% if a user tries to click and drag the form to a new location on the screen.

    If the user merely clicks on the form, I would like the opacity to change the same. Only when the form is clicked and dragged is the opacity supposed to change to 75%.

  4. #4
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: Click & drag opacity change

    This is one way of doing it, the boolean flag is there because the move event fires as soon as the from is displayed, this one needs to be ignored.

    vb Code:
    1. Dim ignoreFirst As Boolean = False
    2.  
    3.     Private Sub Form1_Move(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Move
    4.         If ignoreFirst Then
    5.             Me.Opacity = 0.75
    6.         End If
    7.         ignoreFirst = True
    8.     End Sub
    If my post helps , please feel free to rate it

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Re: Click & drag opacity change

    Tinbeard,

    I tried that code and it did not change the opacity as expected

  6. #6
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: Click & drag opacity change

    hmm works fine for me, does anything happen ?
    If my post helps , please feel free to rate it

  7. #7
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: Click & drag opacity change

    75% opacity is actually .75 in code. So 100% opacity would just be 1.0

    And yea. it works for me as well

    Make sures you be uzin da right event!

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