home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / App_ProFil2079588152007.psc / ctlFader2.ctl < prev   
Text File  |  2007-08-12  |  3KB  |  105 lines

  1. VERSION 5.00
  2. Begin VB.UserControl F 
  3.    ClientHeight    =   330
  4.    ClientLeft      =   0
  5.    ClientTop       =   0
  6.    ClientWidth     =   630
  7.    ForwardFocus    =   -1  'True
  8.    HasDC           =   0   'False
  9.    InvisibleAtRuntime=   -1  'True
  10.    ScaleHeight     =   330
  11.    ScaleWidth      =   630
  12.    Windowless      =   -1  'True
  13.    Begin VB.Label lbName 
  14.       AutoSize        =   -1  'True
  15.       BackColor       =   &H00800000&
  16.       BorderStyle     =   1  '│µ╜u⌐T⌐w
  17.       Caption         =   "Name"
  18.       BeginProperty Font 
  19.          Name            =   "MS Sans Serif"
  20.          Size            =   8.25
  21.          Charset         =   0
  22.          Weight          =   700
  23.          Underline       =   0   'False
  24.          Italic          =   0   'False
  25.          Strikethrough   =   0   'False
  26.       EndProperty
  27.       ForeColor       =   &H00FFFFFF&
  28.       Height          =   255
  29.       Left            =   0
  30.       TabIndex        =   0
  31.       Top             =   15
  32.       Width           =   555
  33.    End
  34. End
  35. Attribute VB_Name = "F"
  36. Attribute VB_GlobalNameSpace = False
  37. Attribute VB_Creatable = True
  38. Attribute VB_PredeclaredId = False
  39. Attribute VB_Exposed = False
  40. Option Explicit
  41.  
  42. 'This code is based om a submission to PSC by Ed Preston
  43. 'And then <i>ULLI the guy made it a control
  44. 'Now this is a concise version of what ProFile needs
  45.  
  46. Private ParhWnd As Long
  47. Public MyTransNow As Integer
  48. Public Event FadeInReady()
  49. Public Event FadeOutReady()
  50.  
  51. Public Sub PrepareFade()
  52.     If GetSet("Fade", "1") = "0" Then Exit Sub
  53.     MakeTransparent ParhWnd, 1
  54. End Sub
  55.  
  56. Public Sub FadeIn()
  57.     Dim I As Integer, D As Integer
  58.     Dim L As Long, K As Long
  59.     Dim O As Double
  60.  
  61.     If GetSet("Fade", "1") = "0" Then
  62.         RaiseEvent FadeInReady
  63.         Exit Sub
  64.     End If
  65.  
  66.     I = Val(GetSet("Opacity", 100))
  67.     If I > 0 And MyTransNow <> I Then
  68.         L = GetTickCount()
  69.  
  70.         For D = MyTransNow To I Step Speed 'So its dependent on the size of the form
  71.             'note how MyTransNow changes
  72.             MakeTransparent ParhWnd, D
  73.             DoEvents
  74.             Sleep 1
  75.         Next
  76.  
  77.         K = GetTickCount()
  78.  
  79.         O = Val(GetSet("Opacity_Speed", "1")) * ((K - L) / 1000)
  80.         Debug.Print "O2: " & O
  81.  
  82.         If O < 1 Then O = 1
  83.         If O > 10 Then O = 10
  84.         SaveSet "Opacity_Speed", Str(O)
  85.         MakeTransparent ParhWnd, I 'End up value of I
  86.         MyTransNow = I
  87.     Else
  88.         MakeOpaqu I
  89.     Else
  90.     tMakerleeOpapo=   &H00F rpO tted upSpaqu   &H0OSSSSSorpO tted upSpat
  91.  t()
  92.  
  93.        pace = False
  94. ">a &H0OSSSSSorpodO ttrent ParhWnd,Dt SSSSorpOParhWnd,Dt SSSrSorpO ttdupSdrhWnd,Dt Li  ood", Str(O)
  95.             0hWnd,DtpO tted upSpat
  96.  t()OSrSorpO Ayu   &H0OSSSSSooOSrSorpO AyuakeOogSSSooOSrSorpO upSpat
  97.  t1l1Wnd,DtpO tted 'oe upSnsn" & O
  98.  
  99.         If O itySIKO ttedtrlic Event Fade e NO Debug"Fented 'oe upSnsn" & O DSrng"&KrpO ttdupS I  & O DSrng"&KrNuakeend,Dt SSSS)KO DS LoSrno'ty OSSSSSooe 1nsNow = e a(O)
  100. ,oOSSSleSSooOSrSorp0iI& OorpO upSpat
  101.  t1l1et("OpaqCLyat
  102.  t1Sooe L  = 5I& nsSusoSooOSrSrLbSooe L seS<n  = sllll RaiseEvent FadeInReady
  103.         Exit fTO upSpat"eady
  104.    = GetTicnS>LSaveSoS>LS>ody
  105.    =sbAargorp0iIO