1. Tag-tag Dasar HTML
  • HTML
  • Head
  • Title
  • Body
  • Paragraf
  • Line Break
  • Heading
  • Mengatur Letak Heading
  • Penggaris Mendatar
  • Komentar
  • Tag - tag Dasar HTML
  • Catatan Tips yang berguna
2. Pemformatan Teks HTML
  • Performatan Teks
  • Teks Preformat
  • Computer Output
  • Address
  • Singkatan
  • Arah Teks
  • Quotation
  • Teks yang disisipkan atau Dihapus
  • Tag - tag Pemformatan
  • Tag - tag Computer-Output
  • Tag Citation, Quotation, Definition
3.








Syntax Form 1


Imports System.IO
imports System.Data.OleDb
Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents btnReferesh As System.Windows.Forms.Button
Friend WithEvents ImageMenu As System.Windows.Forms.ContextMenu
Friend WithEvents mnuImageChange As System.Windows.Forms.MenuItem
Friend WithEvents mnuAddNewImage As System.Windows.Forms.MenuItem
Private Sub InitializeComponent()
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.btnReferesh = New System.Windows.Forms.Button
Me.ImageMenu = New System.Windows.Forms.ContextMenu
Me.mnuImageChange = New System.Windows.Forms.MenuItem
Me.mnuAddNewImage = New System.Windows.Forms.MenuItem
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'DataGrid1
'
Me.DataGrid1.DataMember = ""
Me.DataGrid1.Dock = System.Windows.Forms.DockStyle.Bottom
Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(0, 44)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.ReadOnly = True
Me.DataGrid1.Size = New System.Drawing.Size(542, 349)
Me.DataGrid1.TabIndex = 0
'
'btnReferesh
'
Me.btnReferesh.Location = New System.Drawing.Point(12, 12)
Me.btnReferesh.Name = "btnReferesh"
Me.btnReferesh.Size = New System.Drawing.Size(64, 24)
Me.btnReferesh.TabIndex = 1
Me.btnReferesh.Text = "Referesh"
'
'ImageMenu
'
Me.ImageMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuImageChange, Me.mnuAddNewImage})
'
'mnuImageChange
'
Me.mnuImageChange.Index = 0
Me.mnuImageChange.Text = "Change Image"
'
'mnuAddNewImage
'
Me.mnuAddNewImage.Index = 1
Me.mnuAddNewImage.Text = "Add New Image"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(542, 393)
Me.Controls.Add(Me.btnReferesh)
Me.Controls.Add(Me.DataGrid1)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)

End Sub

#End Region
Dim ItemPicture As System.Windows.Forms.PictureBox
Dim dgCell As DataGridCell
Dim colStyle As GridColumnStylesCollection
Dim dgStyle As New DataGridTableStyle
Dim dgTable As DataGridTextBoxColumn
Dim blnNew As Boolean = False
Dim intRow As Integer, intCol As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
intRow = 0

ItemPicture = New PictureBox
ItemPicture.Width = 148
ItemPicture.Height = 124
ItemPicture.Cursor = System.Windows.Forms.Cursors.Arrow
ItemPicture.Dock = DockStyle.Fill

ItemPicture.SizeMode = PictureBoxSizeMode.StretchImage

AddHandler ItemPicture.Click, AddressOf ClickCBO
RefereshRec()

End Sub
Private Sub ClickCBO(ByVal sender As System.Object, ByVal e As System.EventArgs)
ItemPicture.ContextMenu = (ImageMenu)
End Sub
Private Sub btnReferesh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReferesh.Click
RefereshRec()
End Sub
Private Sub RetreiveImages()
Try
Dim MyData As Byte() = Nothing
Dim crPosition As Integer

crPosition = Me.BindingContext(dt).Position

If blnNew = True Then ItemPicture.Image.Dispose()
blnNew = True
MyData = CType(ds.Tables(0).Rows(crPosition)("ItemPicture"), Byte())

Dim intData As New Integer
intData = MyData.GetUpperBound(0)
Dim fs As New FileStream("c:\tempimage.jpg", FileMode.OpenOrCreate, FileAccess.Write)
fs.Write(MyData, 0, intData)
fs.Close()

MyData = Nothing

ItemPicture.Image = Image.FromFile("c:\tempimage.jpg")

Catch ex As Exception
' MessageBox.Show(ex.Message.ToString)
Finally

cn.Close()
End Try

End Sub

Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.CurrentCellChanged
RetreiveImages()
End Sub

Private Sub RefereshRec()

cmd.CommandText = "SELECT ItemsID, Item as Item, ItemPicture FROM tblPicture ORDER BY ItemsID"
cmd.CommandType = CommandType.Text
cmd.Connection = cn
da.SelectCommand = cmd
ds.Clear()
da.Fill(ds, "tblPicture")
dt = ds.Tables("tblPicture")

dgStyle.MappingName = dt.TableName
DataGrid1.TableStyles.Add(dgStyle)
dgStyle.PreferredRowHeight = 135
dgStyle.PreferredColumnWidth = 205


colStyle = DataGrid1.TableStyles(0).GridColumnStyles
DataGrid1.DataSource = dt
colStyle(0).Width = 150
colStyle(1).Width = 150
colStyle(2).Width = 150

dgTable = CType(DataGrid1.TableStyles(0).GridColumnStyles(2), DataGridTextBoxColumn)
ItemPicture.Visible = True
ItemPicture.Focus()
dgTable.TextBox.Controls.Add(ItemPicture)

Dim dgCell As DataGridCell
dgCell = New DataGridCell(intRow, 2)
DataGrid1.CurrentCell = dgCell
End Sub

End Class



Syntax Modul Connection


Imports System.Data.OleDb


Module Connection
Public cn As New OleDbConnection
Public cmd As New OleDbCommand
Public da As New OleDbDataAdapter
Public ds As New DataSet
Public dt As DataTable
Public dr As DataRow
Public strFilename As String
Sub main()
Try
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & "\pcDataGrid.mdb"
Application.Run(New Form1)

Catch ex As Exception

End Try

End Sub

End Module


Syntax AssemblyInfo

Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices

' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.

' Review the values of the assembly attributes









'The following GUID is for the ID of the typelib if this project is exposed to COM


' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:



syntax nya yaitu :

Public Class Form1
Private intPosition As Integer

Private Sub cmdFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles cmdFile.Click
OpenFileDialog1.Filter = "Text Documents (*.txt)|*.txt|All Files (*.*)|*.*"
OpenFileDialog1.Title = "Select a Text Document"

Try
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Dim sr As New System.IO.StreamReader(OpenFileDialog1.FileName)
txtText.Text = sr.ReadToEnd
sr.Close()
End If
Catch eror As Exception
MessageBox.Show(Err.Description, "Search", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try

End Sub

Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
If Me.txtSearch.Text = "" Then
MessageBox.Show("Enter Search String.", "Search", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.txtSearch.Focus()
Exit Sub
End If
Static intStart As Integer
Dim objType As Object
If optInsensitive.Checked = True Then
objType = CompareMethod.Text
ElseIf optSensitive.Checked = True Then
objType = CompareMethod.Binary
End If

Select Case UCase(Me.cmdSearch.Text)
Case "SEARCH"
Me.cmdSearch.Text = "Search Next"
intPosition = 1
intStart = InStr(intPosition, Me.txtText.Text, Me.txtSearch.Text, objType)

Case "SEARCH NEXT"
intPosition = intStart + Me.txtSearch.Text.Length
intStart = InStr(intPosition, Me.txtText.Text, Me.txtSearch.Text, objType)

End Select
If intStart > 0 Then
Me.txtText.SelectionStart = intStart - 1
Me.txtText.SelectionLength = Me.txtSearch.Text.Length
Me.txtText.Select()
Me.txtText.ScrollToCaret()

Else
Call OptionsChanged(Me, Nothing)
MessageBox.Show("Search String NOT Found.", "Search", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.txtSearch.SelectAll()

End If

End Sub
Private Sub OptionsChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles optInsensitive.CheckedChanged, optSensitive.CheckedChanged, txtSearch.TextChanged
If UCase(Me.cmdSearch.Text) = "SEARCH NEXT" Then
Me.txtText.Select(1, 0)
Me.txtText.ScrollToCaret()
Me.cmdSearch.Text = "Search"
intPosition = 1
Me.txtSearch.Focus()
End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub

End Class