Results 1 to 5 of 5

Thread: Opacity/Fading/Transparency, please help

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    32

    Opacity/Fading/Transparency, please help

    Ok heres what I want to do... I want my program to fade from opactity 0 to opacity 100 when the form loads... ive tried many things, but i cant seem to get anything to work. Please help, I really could use it.

    Josh
    Last edited by pylesj; Aug 29th, 2003 at 09:05 PM.
    Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com

  2. #2
    Addicted Member Bazza81's Avatar
    Join Date
    Apr 2001
    Location
    Nottingham, UK
    Posts
    203
    Opacity is stored as a 'double' value from 0 being transparent and 1 being opaque.

    For instance 0.5 is half way.

    VB Code:
    1. For d As Double = 0 to 1 Step 0.01
    2.      Me.Opacity = d
    3. Next d
    Who needs rhetorical questions anyway?


    Bazza NET - The place you want to be!

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    32
    Ok thanks, I found a solution, but now heres what I need... I have the program masked using Transparency Key, so how do I make it draw in each step? I am using a timer, so on each tick, it adds .01 to the opacity, it may slow the transparency down, but that pink is annoying... anyone help? heres the code:



    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
    Me.Opacity += 0.1 'Look at this, we are increasing the opacity property
    'Now let's check to see if the opacity has gone from 1 to 0 yet.
    If Me.Opacity = 1 Then 'If it is then
    Me.Timer2.Enabled = False
    End If
    End Sub
    Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    32
    Does anyone know???
    Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2003
    Posts
    32
    no one knows?
    Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com

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