10 Tips and Trick Visual Basic From Vb Bego Forum

1.Denied deletion file, this trick are open the file for simultan so the windows couldn’t delete the file until the aplication end or stopped
private sub form_load()
timer1.interval = 1
end sub
Private sub timer1_timer()
Open PathFilenya For Input As 1
end sub

2.Random Coloured label, this trick will change your label each sec
Private Sub Timer1_Timer()
randomize()
Label1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub

3.Set the Attributes file without API function
Private Sub Command1_Click()
Setattr pathname,vbhidden+vbsystem+vbreadonly
End Sub
‘To make it normal
Private Sub Command1_Click()
Setattr pathname,vbnormal
End Sub

4. Animated form when unload
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
‘The form go up
Do Until Me.Top <= -5000
DoEvents
Me.Move Me.Left, Me.Top – 10
DoEvents
Loop
Unload Me
End Sub

5.Gradiation Back Color Form
Private Sub Form_Load()
Form1.AutoRedraw = True
For x = 0 To ScaleHeight
Line (1, x)-(ScaleWidth, x), RGB(5, 10, 255 – (x * 255) \ ScaleHeight)
Next x
End Sub

6. Select all content in textbox the easiest way and always used by POS or accounting application just insert these code to event proc
SendKeys “{home}+{end}”

7. UnClosed Form
Private Sub Form_Unload (Cancel as Integer)
Cancel = 1
End Sub

8. ASCII Detector
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Me.Caption = KeyCode
End Sub

9. Check the existence of Folder or Files
‘Check the Folder
If Dir$(Text1.Text, vbDirectory) = “” Then
msgbox “Folder Not Exist”, vbinformation
ElseIf Dir$(Text1.Text, vbDirectory) <> “” Then
msgbox “Folder Exist”, vbinformation
End If
‘Check The File
If Dir(Text1.Text) = “” Then
msgbox “File Not Exist”, vbinformation
ElseIf Dir(Text1.Text) <> “” Then
msgbox “File Exist”, vbinformation
End If

10. Dragging the Form from around of your form
Private move_x As Integer
Private move_y As Integer
Private move_form As Boolean
Private Sub form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
move_x = X
move_y = Y
move_form = True
End Sub
Private Sub form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If move_form Then
Me.Move Me.Left + X – move_x, Me.Top + Y – move_y
DoEvents
End If
End Sub
Private Sub form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
move_form = False
End Sub

okey thanks for your attention, critics and suggestion are welcome
speciall thx to all poster at vb-bego.net
moderator and admin…

9 Responses to “10 Tips and Trick Visual Basic From Vb Bego Forum”


  1. 1 ade purnama 10 February, 2008 at 6:37 pm

    Hai teman ada yang tau cara bikin fungsi Rec faile Mp3 dengan Visual Basic 06 kg kalau ada tolong kring listingnya dong sekalian programnya ke E-mail aku purnama_1983@yahoo.co.id sebelumnya aku ucapkan terimakasih kepada teman2 yang mau berbagi ilmunya dengan ku

  2. 2 WAHYU 27 February, 2008 at 5:26 pm

    KLO ADA YG TAU SEKALIAN DOOONG TAMBAHIN KAMUS VB THANKS

  3. 3 arizane 28 February, 2008 at 11:46 pm

    @ade purnama
    @wahyu

    coba ubek2 divbbego semuanya ada disitu pak

    http://www.vb-bego.net

  4. 4 admin_papa 31 August, 2008 at 1:02 pm

    Hi Folks!

    Just wanted to share my new experience.

    If your Windows XP denies to run due to an error corresponding to missing HAL.DLL, invalid Boot.ini or any other important system boot files you can fix this by using the XP installation CD. Just boot from your XP Setup CD and enter the Recovery Console. Then launch “attrib -H -R -S” on the C:\Boot.ini file and remove it. Run “Bootcfg /Rebuild” and then Fixboot

    Regards,
    Carl

  5. 5 arjuna 27 February, 2009 at 1:37 pm

    mas, da g sintak utk kotak masuk mas………
    tlng dijwb dgn sgra
    ya….
    thnx………..!!!!!!!!!!!!!!!

  6. 6 PoryTyloalo 24 April, 2009 at 4:28 pm

    I’m the only one in this world. Can please someone join me in this life? Or maybe death…

  7. 7 vicram 20 May, 2009 at 10:12 am

    saya vikram..mohon bantuannya..!
    saya baru belajar vb.. dan saya mencoba membuat kamus bahasa indonesia-aceh dengan menggunakan sistem pakar…. tolong saya bagaimana saya bisa melanjutkan tugas saya….
    terimakasih atas bantuannya…!

  8. 9 vicram 29 October, 2009 at 9:32 pm

    kawan..aku kebingungan saat aku harus buat sebuah program vb yang bisa mengeluarkan suara.
    aku gak ngerti sama sekali ttg itu..sedangkan di vb aku gak ada direct text to speech nya..jadi aku harus gimana???
    aku bisa download dimana component vb tsb, sekalian juga syntaxnya…
    terima kasih atas bantuan,,kawan2 sebelumnya…!!!


Leave a Reply




Official Of Arizane Blog

Komunitas

Indonesian Muslim Blogger KampungBlog.com - Kumpulan Blog-Blog Indonesia

a

Top Browsers

Mozilla

Visitor