membuat dinamis button dan dinamis listview pada vb 2010
di kesempatan kali ini saya akan berbagi bagaimana membuat dinamis button dan dinamis listview setelah sekian lama tidak posting,
okey gays,. silahkan copy paste and happy coding
contoh 1: membuat dinamis button, dan letakan di form load..
dim b11 as new button
b11.Text = "SHOW"
b11.ForeColor = Color.White
b11.BackColor = Color.Blue
b11.Size = New System.Drawing.Size(140, 30)
b11.Location = New Point(5, 10 * 35)
AddHandler b11.Click, Sub(sender As Object, e As EventArgs)
msgbox("selamat pagi bos")
End Sub
contoh 2 : membuat dinamis listview, dan letakan di form load
Dim at As Integer = Me.Width / 7
listview1 = New ListView
listview1.View = View.Details
listview1.LabelEdit = True
listview1.AllowColumnReorder = True
listview1.FullRowSelect = True
listview1.GridLines = True
listview1.Sorting = SortOrder.Ascending
listview1.Location = New Point(5, 40)
listview1.BackColor = Color.DarkGreen
listview1.ForeColor = Color.Yellow
listview1.Font = New Font("Agency FB", 16)
listview1.Size = New Size(GroupBox1.Size.Width - 10, GroupBox1.Size.Height - 50)
listview1.Columns.Add("Tanggal", at, HorizontalAlignment.Center)
listview1.Columns.Add("Nama Line", at, HorizontalAlignment.Center)
listview1.Columns.Add("Plan", at, HorizontalAlignment.Center)
listview1.Columns.Add("Target", at, HorizontalAlignment.Center)
listview1.Columns.Add("Aktual", at, HorizontalAlignment.Center)
listview1.Columns.Add("OK", at, HorizontalAlignment.Center)
listview1.Columns.Add("NG", at, HorizontalAlignment.Center)
Controls.Add(listview1)
Me.GroupBox1.Controls.Add(listview1)
apa bila agan kurang mengerti bisa tinggalkan commentarnya dibawah,.
okey gays,. silahkan copy paste and happy coding
contoh 1: membuat dinamis button, dan letakan di form load..
dim b11 as new button
b11.Text = "SHOW"
b11.ForeColor = Color.White
b11.BackColor = Color.Blue
b11.Size = New System.Drawing.Size(140, 30)
b11.Location = New Point(5, 10 * 35)
AddHandler b11.Click, Sub(sender As Object, e As EventArgs)
msgbox("selamat pagi bos")
End Sub
contoh 2 : membuat dinamis listview, dan letakan di form load
Dim at As Integer = Me.Width / 7
listview1 = New ListView
listview1.View = View.Details
listview1.LabelEdit = True
listview1.AllowColumnReorder = True
listview1.FullRowSelect = True
listview1.GridLines = True
listview1.Sorting = SortOrder.Ascending
listview1.Location = New Point(5, 40)
listview1.BackColor = Color.DarkGreen
listview1.ForeColor = Color.Yellow
listview1.Font = New Font("Agency FB", 16)
listview1.Size = New Size(GroupBox1.Size.Width - 10, GroupBox1.Size.Height - 50)
listview1.Columns.Add("Tanggal", at, HorizontalAlignment.Center)
listview1.Columns.Add("Nama Line", at, HorizontalAlignment.Center)
listview1.Columns.Add("Plan", at, HorizontalAlignment.Center)
listview1.Columns.Add("Target", at, HorizontalAlignment.Center)
listview1.Columns.Add("Aktual", at, HorizontalAlignment.Center)
listview1.Columns.Add("OK", at, HorizontalAlignment.Center)
listview1.Columns.Add("NG", at, HorizontalAlignment.Center)
Controls.Add(listview1)
Me.GroupBox1.Controls.Add(listview1)
apa bila agan kurang mengerti bisa tinggalkan commentarnya dibawah,.
Komentar
Posting Komentar