1icax
New member
- Joined
- May 14, 2024
- Messages
- 2
- Programming Experience
- Beginner
HELO EVERYONE
this windows form and mysql
code form1
I made a simple program with VB Net and MySQL
when the f9 button is pressed it immediately saves to the database
when pressed it is saved to the database
the problem
when the form is hidden/ minimize the f9 button cannot save to the database
Please help
this windows form and mysql
code form1
form1:
Public Class Form1
Private Sub Form1_Activated(sender As Object, e As EventArgs) Handles Me.Activated
lcom.Text = Environment.MachineName
End Sub
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Me.WindowState = FormWindowState.Minimized
Me.Visible = False
e.Cancel = True
End Sub
Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
Select Case e.KeyCode
Case Keys.F9
con()
cmd.Connection = conn
cmd.CommandType = CommandType.Text
cmd.CommandText = "insert into info ( jam, tanggal, computer) VALUES ('" & Format(Now, "HH:mm:ss") & "','" & Format(Now, "yyyy-MM-dd") & "','" & lcom.Text & "')"
cmd.ExecuteNonQuery()
End Select
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
lcom.Text = Environment.MachineName
ldatetime.Text = Now
End Sub
I made a simple program with VB Net and MySQL
when the f9 button is pressed it immediately saves to the database
when pressed it is saved to the database
the problem
when the form is hidden/ minimize the f9 button cannot save to the database
Please help