Skip to main content

Posts

Showing posts from December, 2009

animasi dengan vB

Dim FrameCount As Long Private Sub Command1_Click() Timer1.Enabled = False If LoadGif(Text1, Image1) Then FrameCount = 0 Timer1.Interval = CLng(Image1(0).Tag) Timer1.Enabled = True End If End Sub Private Sub Command2_Click() Timer1.Enabled = False End Sub Private Sub Command3_Click() Timer1.Enabled = True End Sub Private Sub Form_Load() Text1.Text = App.Path & IIf(Right(App.Path, 1) = “\”, “”, “\”) & “clip.gif” Timer1.Enabled = False End Sub Private Sub Timer1_Timer() If FrameCount < TotalFrames Then Image1(FrameCount).Visible = False FrameCount = FrameCount + 1 Image1(FrameCount).Visible = True Timer1.Interval = CLng(Image1(FrameCount).Tag) Else FrameCount = 0 For i = 1 To Image1.Count - 1 Image1(i).Visible = False Next i Image1(FrameCount).Visible = True Timer1.Interval = CLng(Image1(FrameCount).Tag) End If End Sub

belajar visual basic

CHECK FOR FILE Public Function FileExist(asPath as string) as Boolean If UCase(Dir(asPath))=Ucase(trimPath(asPath)) then FileExist=true Else FileExist=False End If End Function Public Function TrimPath(ByVal asPath as string) as string if Len(asPath)=0 then Exit Function Dim x as integer Do x=Instr(asPath,”\”) if x=0 then Exit Do asPath=Right(asPath,Len(asPath)-x) Loop TrimPath=asPath End Function Private sub command1_Click() if fileExist(Text1.text) then Label1=”YES” else Label1=”NO” End if End Sub Private sub form_Load() End sub