TUGAS MODUL VB

1. Font Color & Font Style

Kode Program :

Private Sub ChkBold_Click()

‘membuat teks tebal

If ChkBold.Value = 1 Then

Lblteks.FontBold = True

Else

Lblteks.FontBold = False

End If

End Sub

Private Sub OptRed_Click()

‘membuat teks berwarna merah

Lblteks.ForeColor = vbRed

End Sub

2. STATUS

Kode Program

‘jika status single dipilih, mendapat tunjangan 50000

‘jika status menikah dipilih, maka mendapat tunjangan 80000

Private Sub Optsingle_Click()

If Optsingle.Value = 1 Then

tunjangan = 50000

End If

End Sub

3. DIALOG

Kode Program

Private Sub cmdColor_Click()

cmdDialog.dialogtitle = “select a color”

cmdDialog.showcolor ‘display the dialog box

End Sub

 

Private Sub cmdFont_Click()

cmdDialog.dialogtitle = “font”

cmdDialog.FileName = “arial”

cmdDialog.FontBold = cdlCFBoth

cmdDialog.showfont

End Sub

 

Private Sub cmdOpen_Click()

cmdDialog.dialogtitle = “file open”

cmdDialog.Filter = “*.txt” ‘tampilkan text saja

cmdDialog.FileName = “*.txt” ‘default nama file

cmdDialog.showopen ‘menampilkan dialog open file

End Sub

Private Sub cmdPrint_Click()

cmdDialog.dialogtitle = “printer”

cmdDialog.showprinter ‘display the dialog box

End Sub

 

Private Sub cmdSave_Click()

cmdDialog.dialogtitle = “file save”

cmdDialog.Filter = “**” ‘show all files

cmdDialog.FileName = “test.txt” ‘default filename

cmdDialog.showsave ‘tringger the dialog box

End Sub

Iklan
Dipublikasi di Uncategorized | Meninggalkan komentar

Hello world!

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.
Dipublikasi di Uncategorized | 1 Komentar