تغيير أنواع الملفات بدون برامج في ويندز 10 كالصور مثلا نغير امتدادات الصور المختلفة JPg, Png,Pmp,Gif والفيديوهات نغير بين الامتدادات المختلفة Wmv,mp4,Avi والاصوات mp3, wav وغيرها من الملفات المختلفة بطريقة بسيطة وسهلة.
Retrieve data by timer VB.net - Example: essential English words- First Time
Imports System.Data.OleDb
Imports System.IO
Imports System.Configuration
Imports System.Data
Imports System.Data.DataTable
Public Class Form1
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\english1.mdb")
Dim myreader11 As OleDbDataReader
Dim myreader5 As OleDbDataReader
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
End Sub
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If conn.State = ConnectionState.Closed Then
conn.Open()
End If
Dim myreader1 As OleDbDataReader
Dim strsql As String
strsql = "select id from table1 where id =(select max(id) from table1)"
Dim cmd1 As New OleDbCommand(strsql, conn)
myreader1 = cmd1.ExecuteReader
myreader1.Read()
Label2.Text = myreader1("id")
Timer2.Enabled = True
conn.Close()
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
For aa As Integer = 0 To TextBox1.Text Step 1
aa = TextBox1.Text + 1
TextBox1.Text = aa
Dim strsql As String
strsql = "select id from table1 where id=" + TextBox1.Text + ""
Dim cmd1 As New OleDbCommand(strsql, conn)
If conn.State = ConnectionState.Closed Then
conn.Open()
End If
myreader11 = cmd1.ExecuteReader
If (myreader11.Read()) Or aa < Label2.Text Then
'Try
' TextBox1.Text = myreader1("id")
'Catch
'End Try
load1()
Else
Timer2.Enabled = False
TextBox1.Text = Label2.Text
MessageBox.Show("Words Ended")
Return
End If
Next
conn.Close()
End Sub
Private Sub load1()
Try
Dim conn5 As New OleDbConnection
conn5.ConnectionString = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\english1.mdb")
If conn5.State = ConnectionState.Closed Then
conn5.Open()
End If
Dim strsql5 As String
strsql5 = "select * from table1 where id=" + TextBox1.Text + ""
Dim cmd5 As New OleDbCommand(strsql5, conn5)
myreader5 = cmd5.ExecuteReader
myreader5.Read()
Try
Label3.Text = myreader5("word")
Catch
End Try
Try
Label4.Text = myreader5("ar")
Catch
End Try
Try
Label5.Text = myreader5("en")
Catch
End Try
conn5.Close()
Catch
End Try
End Sub
End Class
Source code : Move picture like space ship VB.net
Public Class Form2
Private slides As Integer
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
slides += 10
If slides <= 20 Then
PictureBox1.Left += 10
ElseIf slides > 20 AndAlso slides <= 40 Then
PictureBox1.Top += 10
ElseIf slides > 40 AndAlso slides <= 60 Then
PictureBox1.Left -= 10
ElseIf slides > 60 AndAlso slides <= 80 Then
PictureBox1.Top -= 10
Else
slides = 0
End If
End Sub
End Class
insert update delete data in datagridview without using database in visual basic.net
Imports System.Data.DataTable
Public Class Form2
Dim table As New DataTable("table")
Dim index As Integer
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
table.Columns.Add("ID", Type.GetType("System.Int32"))
table.Columns.Add("First name", Type.GetType("System.String"))
table.Columns.Add("Last name", Type.GetType("System.String"))
table.Columns.Add("Sum", Type.GetType("System.Int32"))
DataGridView1.DataSource = table
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
table.Rows.Add(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text)
DataGridView1.DataSource = table
End Sub
Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
index = e.RowIndex
Dim selectedrow As DataGridViewRow
selectedrow = DataGridView1.Rows(index)
TextBox1.Text = selectedrow.Cells(0).Value.ToString
TextBox2.Text = selectedrow.Cells(1).Value.ToString
TextBox3.Text = selectedrow.Cells(2).Value.ToString
TextBox4.Text = selectedrow.Cells(3).Value.ToString
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim newdata As DataGridViewRow
newdata = DataGridView1.Rows(index)
newdata.Cells(0).Value = TextBox1.Text
newdata.Cells(1).Value = TextBox2.Text
newdata.Cells(2).Value = TextBox3.Text
newdata.Cells(3).Value = TextBox4.Text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
DataGridView1.Rows.RemoveAt(index)
End Sub
End Class
How to Connect SQL Server Database to VB.NET | Step-by-Step Tutorial with Source Code
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Database2DataSet.Table1' table. You can move, or remove it, as needed.
Me.Table1TableAdapter.Fill(Me.Database2DataSet.Table1)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Table1BindingSource.MovePrevious()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Table1BindingSource.AddNew()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Table1BindingSource.MoveNext()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Table1BindingSource.EndEdit()
Table1TableAdapter.Update(Database2DataSet)
MessageBox.Show("Data Saved")
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Table1BindingSource.RemoveCurrent()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Me.Close()
End Sub
End Class
Subscribe to:
Posts (Atom)
