Professional Documents
Culture Documents
===============================================
3 Kali Validasi Login
==================================================================
===============================================
==================================================================
===============================================
Buka File Gambar
==================================================================
===============================================
==================================================================
===========
Disabled Tombol X pada Form
==================================================================
===========
==================================================================
==========
DataGridView select 1 baris
==================================================================
==========
Private Sub dataGridView1_CellEnter(ByVal sender As Object, ByVal e As
DataGridViewCellEventArgs) Handles dataGridView1.CellEnter
dataGridView1.Rows(e.RowIndex).Selected = True
End Sub
==================================================================
==========
DataGridView ubah warna kalau Quantity kurang dari 5
==================================================================
==========
Private Sub DataGridView1_CellFormatting(ByVal sender As Object, ByVal e As
DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting
For i As Integer = 0 To Me.DataGridView1.Rows.Count - 1
If Me.DataGridView1.Rows(i).Cells("Quantity:") < 5 Then
Me.DataGridView1.Rows(i).Cells("Quantity:").Style.ForeColor = Color.Red
End If
Next
End Sub
==================================================================
==========
Button Image Animation
==================================================================
==========
Private Sub simulateButtonPress(ByRef pictureBox As
Infragistics.Win.UltraWinEditors.UltraPictureBox)
pictureBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Inset
Application.DoEvents()
System.Threading.Thread.Sleep(400)
pictureBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Raised
Application.DoEvents()
End Sub
==================================================================
==========
Open Form in Other Monitor
==================================================================
==========
form2.Location=Screen.AllScreens(UBound(Screen.AllScreens)).Bounds.Location + new
Point(100,100)
==================================================================
==========
Warna DataGrid
==================================================================
==========
For i As Integer = 0 To Me.DataGridView1.Rows.Count 1
If Me.DataGridView1.Rows(i).Cells(stok).Value = 0 Then
Me.DataGridView1.Rows(i).Cells(stok).Style.BackColor = Color.Red
End If
Next
==================================================================
==========
TABPages
==================================================================
==========
If TabControl1.TabPages.Contains(tabDataPegawai) Then
TabControl1.SelectedTab = tabDataPegawai
Else
TabControl1.TabPages.Insert(0, tabDataPegawai)
TabControl1.SelectedTab = tabDataPegawai
End If
TabControl1.TabPages.Remove(tabDataPegawai)
==================================================================
==========
Lokasi Komponen Better Code
==================================================================
==========
label1.Top = 20
label1.left = 40
==================================================================
==========
DATETIMEPICKER AUTO MOVE TO OTHER
==================================================================
==========
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles DateTimePicker1.ValueChanged
SendKeys.Send("{/}")
End Sub
==================================================================