LINK
Login




 


 Log in Problems?
 New User? Sign Up!
E-Learning
Online
There are 1 unlogged user and 0 registered users online.

You can log-in or register for a user account here.


 

!**************************************

! Name: Random Warna

! Description : mengganti warna form

! secara acak

! copyright : Maggot #10

! www.master.ac.id
!**************************************

 

1. Tambahkan komponen Timer

2. Listing pada Timer1 :

------------------------------------

With Borland Delphi

------------------------------------

procedure TForm1.Timer1Timer(Sender: TObject);

begin

      Form1.Color := TRUNC(RANDOM * clRed);

end;

------------------------------------

With Visual Basic

------------------------------------

 

Dim Red, Green, Blue As Integer

 

Private Sub Timer1_Timer()

      Red = Int(Rnd * 255)

      Green = Int(Rnd * 255)

      Blue = Int(Rnd * 255)

 

      Form1.BackColor = RGB(Red, Green, Blue)

End Sub

 

 

 

 
Print this | Send this | Hits: 705 |